Home >Web Front-end >Bootstrap Tutorial >How to set the background in bootstrap

How to set the background in bootstrap

藏色散人
藏色散人Original
2021-12-28 17:08:599981browse

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;" .

How to set the background in bootstrap

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! ! !

You only need to write

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.

Supplement:

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn