Forum Moderators: open

Message Too Old, No Replies

td background image overlaps the cell

td background image overlaps the cell

         

orhor

3:23 pm on Mar 6, 2005 (gmt 0)

10+ Year Member



Hi all,
here's my question:

When I set a background image for a cell of a table, doing this by setting BACKGROUND attribute to TD tag in HTML (not valid - I know) or making this with background-image: in css, it always looks in IE6 as the cell has its background OK but the background image is displayed once more under this cell but only 4 px high.

In firefox it looks OK.

The table has cellspacing=0 cellpading=0, i tried make the same with css too (padding: 0; border-collapse: collapse; )

Can somebody advice pls?

tedster

1:14 pm on Mar 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to the forums, orhor. Sorry it's taken so long for anyone to answer you, and I wish I had a good answer, but I don't. What seems clear is that the image is tiling in Explorer and that makes me think it's a box model problem of some kind.

Is the page in quirks more or standrads mode?

Afkamm

1:21 pm on Mar 11, 2005 (gmt 0)

10+ Year Member



Have you tried using no-repeat? If the cell is slightly larger than the image, then the image will get repeated.

style="background-image: url(image.jpg); background-repeat: no-repeat; background-position: center center;"

More info can be found at [w3schools.com ] :)