Answer the question
In order to leave comments, you need to log in
How to deal with image CSS?
There are five html pages and you need to make sure that each page has different background images. the code in CSS is like this
.background{
display: block;
width: 100%;
height: 100%;
background: url(index.jpg);
position: fixed;
background-size: cover;
}
<div class="index"></div>
background: url(index.jpg);
Answer the question
In order to leave comments, you need to log in
.page1 {
background: url(index.jpg);
}
.page2 {
background: url(index2.jpg);
}
<div class="background page1"> </div>
<div class="background" style="background-image: url(bg.jpg)"></div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question