1
I’d like to do with that div
roll along with the page but its contents or the contents of a before that would be in the case of the image (if applicable), it would be fixed so that the content (or background) appears to disappear when scrolling the page.
In fact, as I did the fund was fixed but it was not disappearing according to what I scroll down the page. The idea is to make like one overflow: hidden
.
#teste {
width: 100%;
height: 100%;
position: relative;
}
#teste:before {
content: '';
width: 100%;
height: 100%;
top: 0;
left: 0;
background-image: url("https://upload.wikimedia.org/wikipedia/commons/8/8f/%24700%2C000_Home.jpg");
background-size: cover;
position: fixed;
overflow: hidden;
}
<div id=teste></div>
eu <br />
eu <br />
eu <br />
eu <br />
eu <br />
eu <br />
eu <br />
eu <br />
eu <br />
eu <br />
eu <br />
eu <br />
I’m not sure I understand, but is that what you want? https://repl.it/@Costamilam/Hurtfulhilariouskeygens
– Costamilam
No! What I want to do is what happens on the banner at the top of this site: https://www.banesecard.com.br/Home/
– Carlos Rocha
But could you change this example to just div.imagem and a block of me <br /> as in the question to make the effect that occurs in div.imagem continue to occur? However, instead of content before ter 'Imegem', I would like there to be an image, it can be google, that had the dimensions of the div.
– Carlos Rocha
I don’t quite understand what you want, it seems you already have what you want, just pack the
z-index
how hugocsl responded. You can inspect element and see how it was done on the site to ask any questions– Costamilam
Carlos I completely edited the answer, I think now is more in agreement with the effect you wanted
– hugocsl