HTML: Image with absolute position, text flow over. How to do it?
I'm trying to modify a code not written by me, so I want to modify only what's necessary, to not mess up with an entire site.
I want to achieve this http://www.yourhtmlsource.com/examples/positioning1.html
but with the image in the back, instead of being in front of text.
How can I do it without using position:absolute on text?
(source:http://ww开发者_如何学Pythonw.yourhtmlsource.com/stylesheets/csslayout.html)
Just add a z-index
z-index:1;
to the image
z-index:2;
to the text-div
It sounds like your trying to set a background image. In that case you need to use something like
body {
background-image: url("http://yoursite.com/images/image_name.gif");
background-position: 50% 50%;
background-repeat: no-repeat;
}
精彩评论