views:

217

answers:

2

I have a page with a div in it.

The div contains an image, is 700px wide and 300px tall. It is set to position: relative.

To show some text to the bottom of the DIV, I put a span into it and give it position: absolute; bottom: 8px

This works fine in all browsers, except IE6. IE6 puts the text to the very bottom of the page.

It is as if the parent element with its position: relative doesn' t even exist.

Is this known IE6 behaviour, or am I overlooking something?

I just checked, the HTML code passes W3C validation.

+1  A: 

Did you set a height to your div? If there is no height set, IE6 considers this element as non existent.

Nip
Not explicitly, no. Could this have to do with having layout? I'll try a `zoom: 1` hang on.
Pekka
Cheers for getting me on the right track, a `zoom: 1` did it. (I can't set an explicit height.)
Pekka
+1  A: 

I would say, use the

height:auto!important;
height:1px;

trick that will validate as well, and also give layout to IE6 which does not support the !important directive..

Gaby
+1 for finding a w3c valid solution. Thanks!
Pekka
no problem.. I know you always strive for w3c compliance.
Gaby