Forum Moderators: not2easy

Message Too Old, No Replies

CSS, <td>'s, and IE

Problem with CSS in a table with Explorer

         

denimflavored

3:36 pm on Jul 25, 2005 (gmt 0)

10+ Year Member



I have a div inside a <td>. The images in this <div> have relative positioning, which is why they are inside the <div>. My problem is that when the page scrolls the images stay where they are and everything else moves. Does anyone have a solution?

g1smd

3:56 pm on Jul 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is div valid inside a td? It might not be, div is a block element.

Check the code at [validator.w3.org...] first.

denimflavored

4:02 pm on Jul 25, 2005 (gmt 0)

10+ Year Member



I tried taking the <div> outside the table completely and it still does the same thing. Maybe I'll try it in a span.
One thing that I forgot to mention (that is definitely important) is that this table is inside a scrolling <div> (I couldn't use an iframe because I have javascript menus that drop down over the <div>).
Internet Explorer makes me want to hang myself.

SuzyUK

4:57 pm on Jul 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>relative positioning

Is it just IE it's happening in?
if so try adding {zoom: 1;} to the image's containing div, does it help/make it worse/do nothing?

this is off the top of my head.. I saw this before ages ago and can't remember what the fix is (if any) so I'm assuming an IE layout error

If that does work, the fix above is Microsoft Proprietary and while useful for debugging (and it doesn't work for IE5) you might want to use another method of triggering layout..

Let us know what happens and if it does not work can you post the summarised code for your scrolling table, td, div, and image including the CSS..

Suzy

denimflavored

6:27 pm on Jul 25, 2005 (gmt 0)

10+ Year Member



Thanks for your help.
My bosses have decided to go for tables (bleh) and differently-sliced images. I've been pushing for CSS layout from the start, but it's been such a pain for cross-browser compatibility that we've all given up.

g1smd

7:03 pm on Jul 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Please, at least keep the CSS stuff for styling the content in place, even if you have abandoned the positioning code.

cuce

8:48 pm on Jul 25, 2005 (gmt 0)

10+ Year Member



Is div valid inside a td? It might not be, div is a block element.

<Hx> tags are block elements, as well as <p>. this shouldn't be a problem.