2 replies [Last post]
Graham Scott
Offline
newbie
Last seen: 15 years 50 weeks ago
Joined: 2003-06-04
Posts: 2
Points: 0

Hi

I have a page where there is a background image in the body element. I need to overlay a white <div> over the image, and have created an ID of #Heading for this purpose.

I have set my CSS up as follows:

body {
background: url(../Images/menu_bk.gif) repeat-y;
position: absolute;
margin: 0; /* sets all to 0 */
padding: 0; /* think Opera sets padding on body */
}

#Heading{
position:absolute;
height:150px;
width: 100%;
margin-left:0px;
background-color:white;
}

This method is working in IE5.5, IE6 and NS7.1 but not in Opera 7.

Could anyone tell me if this is possible, and if so, what I am doing wrong?

Thanks

Graham

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 day 1 hour ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5342
Points: 2963

Problems with Background image in Opera 7

Hi Graham,
Try setting the top and left position values.
top:0; left:0;for the heading.

If that doesn't work can you post a link to an example.

Graham Scott
Offline
newbie
Last seen: 15 years 50 weeks ago
Joined: 2003-06-04
Posts: 2
Points: 0

Thanks for your reply!

Hi Tony - thanks for your reply

I fixed it like this:

body {
background: url(../Images/menu_bk.gif) repeat-y;
background-position:0px,100px;
margin: 0; /* sets all to 0 */
padding: 0; /* think Opera sets padding on body */
}

#Heading{
position:absolute;
height:150px;
width: 100%;
margin-left:0px;
background-color:white;
}

background-position has made all the difference! I think that this is similar to your suggestion, but I'm just happy it works! I had to remove position:absolute from the body, but I'm pretty sure that this shouldn't make any difference in my particular site...

Thanks once again for taking the time to reply.

Graham