bootstrap sets the background image to adapt to the screen size:
Edit this style in css:
.bg { background:url(图片地址) no-repeat center; background-size:contain; }
Then quote it in your div This style will do:
<div class="row bg">
If the image does not scroll with the scroll bar, that is, if it is fixed, add fixd. The css code is as follows:
.bg { background:url(图片地址) no-repeat center fixed; background-size:contain; }
For more technical articles related to Bootstrap, please visit Bootstrap Tutorial column to learn!
The above is the detailed content of How to set the background image in bootstrap to adapt to the screen size. For more information, please follow other related articles on the PHP Chinese website!