Home >Web Front-end >Bootstrap Tutorial >How to make bootstrap background picture
There are two ways to set the Bootstrap background image: use CSS rules to add a background image: background-image: url(path/to/image.png); use the utility class to add .bg-image, and add it in the style Define rules in the table, including background image path, size, and repeat settings.
Bootstrap background image setting
In Bootstrap, setting the background image is very simple. Two methods are introduced below:
Method 1: Use CSS rules
<code class="css">background-image: url(path/to/image.png);</code>
<code class="css">background-size: cover; background-repeat: no-repeat;</code>
Method 2: Use Bootstrap utility class
<code class="html"><div class="bg-image"></div></code>
<code class="css">.bg-image { background-image: url(path/to/image.png); background-size: cover; background-repeat: no-repeat; }</code>
Note:
The above is the detailed content of How to make bootstrap background picture. For more information, please follow other related articles on the PHP Chinese website!