Home > Article > Web Front-end > How to set the background in bootstrap
How to set the background of bootstrap: 1. Open the corresponding css file; 2. Set the page background through "background: url(../img/QQ picture 20200226123957.jpg) no-repeat;" .
The operating environment of this article: Windows 7 system, bootsrap3.3.7 version, Dell G3 computer.
bootstrap How to set the background?
How to use BootStrap to write a web page and set the background of a full-screen page:
It’s not ridiculous to say it, but the hands of this doubles game have almost forgotten how to write code Yes, when writing a page, when setting the background, inexplicable errors keep appearing.
Record it here, you can’t even know the background settings, even though the front-end is not very good. It also helps beginners or back-end workers avoid pitfalls when checking it out! ! !
body{ background: url(../img/QQ图片20200226123957.jpg) no-repeat; background-size:100%; }
in the css. In other words, the reason I encountered at that time was the size problem. But in the end, what I found was that my previous css overridden this setting, so it kept failing.
If you don’t set one of the values, there will be no problem, such as background:#ff0000 url('smiley.gif' ); is also allowed.
It is generally recommended to use this attribute instead of using individual attributes separately, because this attribute is better supported in older browsers and requires fewer letters to be typed.
Default value: | not specified |
---|---|
Inheritance: | no |
Version: | CSS1 CSS3 |
JavaScript Syntax: | object.style.background="white url(paper.gif) repeat-y" |
Recommended related video tutorials: "bootstrap video tutorial》
The above is the detailed content of How to set the background in bootstrap. For more information, please follow other related articles on the PHP Chinese website!