Forum Moderators: not2easy

Message Too Old, No Replies

Table background image positioning

Background image property

         

eternal

5:20 pm on Sep 28, 2004 (gmt 0)

10+ Year Member



Im not sure if im doing this right but Ive set my tables up and I have a container table that is centered <align="center">. I then have set the css up so that the table contains a background image like so:

background: #FAFBFD url('images/cathedral.jpg') no-repeat fixed 0px 280px;

Now I have set the left co-ordinate to '0' so it will start in the bottom left of the table, but netscape, mozilla and Opera start it at the left of the whole document and not in the table that is centered?

Is there something I need to do here?

thanks for your time.

eternal

5:42 pm on Sep 28, 2004 (gmt 0)

10+ Year Member



Oh, IE positions it correctly in the table.

createErrorMsg

7:44 pm on Sep 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Exactly which element is the background property set on? WHat's the selector in the css?

eternal

9:01 pm on Sep 28, 2004 (gmt 0)

10+ Year Member



Here is my CSS for the table:

.box {
width:700px;
height:560px;
background-color: #FFFFFF;
border: 2px solid #00315A;
background: #FAFBFD url('images/cathedral.jpg') no-repeat fixed 0px 280px;
}

Then obvisouly I just call that table by class="box"

encyclo

12:09 am on Sep 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Fixed background images are fixed relative to the viewport (correctly according to the specs) in Mozilla and Opera. IE incorrectly positions then relative to the parent element.

You'll need to use two positioning rules for the background image: one for IE, and another for Mozilla/Opera, perhaps using a descendant selector to ensure IE doesn't get the "true" position.

eternal

9:13 am on Sep 29, 2004 (gmt 0)

10+ Year Member



OK, I have no idea how to do that tho?