Get the App
SLTechnology News&Howtos  ›  Development  › 

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

Shulou Source: shulou.com Published: 2022-06-01 13:08:05 09月29日 Update

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.

Tags: Picture background background picture knowledge content screen article value principle size width easy to operate article easy to understand more source code look industry information information channel Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Information Docker OPPO Reno NVidia