M
M
MixNik2018-11-23 18:50:57
css
MixNik, 2018-11-23 18:50:57

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;
}

And on the pages themselves, here is the code: I tried to clone the CSS code to add to the background if the picture is written here, the index, then I added it turned out like backgroundindex and in the divs on the pages also changed the value, but the effect was zero (((( I also tried to clone this one in CSS line, replacing index with another value, for example, the name of the picture, also the effect is zero Tell me where and what you need, prescribe or replace so that all the pages of the site have a different background?
<div class="index"></div>
background: url(index.jpg);

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
shmatuan, 2018-11-23
@shmatuan

.page1 {
background: url(index.jpg);
}
.page2 {
background: url(index2.jpg);
}

<div class="background page1"> </div>

P
profesor08, 2018-11-23
@profesor08

<div class="background" style="background-image: url(bg.jpg)"></div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question