tbcarver@yahoo.com wrote:
[color=blue]
> Els wrote:[color=green]
>> Just set a height to the inner div (any height, I usually use 1%, but
>> you have to hide that style from other browsers), and it conforms to
>> what Firefox and Opera do.[/color]
>
> Awesome! This did fix the issue.
>
http://hughaxton.com/NewsGroups/HeightIE2DivsTable.html[/color]
Eh.. not quite :-)
Now the margin-collapsing is in action in Opera :-)
Adding a border to the inner div solves that.
Another thing: you have not hidden the height for the inner div from
other browsers than WinIE. In this particular case it doesn't matter,
but in many other instances it's important that other browsers won't
honour the 1% or 1px height.
You can hide it by adding an underscore to it, like so:
_height:1%; /* the validator doesn't like this hack,
but it is valid CSS2.1 */
or with this hack:
/* hiding from IE Mac \*/
* html .wrapperInside{
height:1%;
}
/* end hide from IE Mac */
[color=blue]
> Els wrote:[color=green]
>> Now you'll probably ask why the outer div when it was by itself,
>> didn't show the same problem. That's because you set a width on it.
>> Either width or height makes the box encompass its contents, whether
>> those contents include elements with margins, or even floats. In WinIE
>> that is![/color]
>
> This is true for the inner div, but not the outer. The outer always
> seems to work even without the height or width. (I added the width to
> the sample for easy of use to the reader)
>
http://hughaxton.com/NewsGroups/IE2DivsTable2.html[/color]
I meant when it was the only div. When you take out the inner div from
the HTML, the outer div collapses just the same in IE.
This effect only happens with the div that's the direct parent of a
table. If you'd substitute the table for a div (with the same margin
and border properties), the parent div would not collapse in the
absence of width and height.
Now, why exactly this difference between the parent of a div and the
parent of a table, I don't know :-)
[color=blue]
> Thanks for help.[/color]
You're welcome :-)
--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: The Beatles - Lovely Rita