Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set the background picture to adapt to full screen by CSS

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the CSS how to set the background picture adaptive full-screen knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that after reading this CSS how to set the background picture adaptive full-screen article will have a harvest, let's take a look.

Source code: CSS sets background image adaptation-(yisu.com) body {position:fixed; top: 0; left: 0; width:100%; height:100%; min-width: 1000px Background: url (. / image/img1.png); / * Image path * / background-repeat: no-repeat; background-size: cover;-webkit-background-size: cover;-o-background-size: cover; background-position: center 0 } implementation principle:

First of all, fix the background picture at the top and left of the screen. Second, set the values of height and width to 100%, and you also need to set min-width, in order to keep the image size unchanged when the screen width is within 1000px. Finally, you need to set the background image not to repeat (no-repeat).

This is the end of the article on "how to set the background picture to adapt to full screen in CSS". Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to set background pictures to adapt to full screen". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report