Firefox DIV Element Issues

They have: 7 posts

Joined: May 2006

I'm currently experiencing a problem with Firefox and Div elements, Here goes.

I have a 'container' div element with loads of other div element inside it. The height of the container element is set to auto. So in theory the height of container element adjusts depending on the size of what's init. In IE this does this correctly. In Firefox the element appears above the elements thats supposed to be in it.

Dopes anyone know the fix for this - Please Help!

Dave

timjpriebe's picture

He has: 2,667 posts

Joined: Dec 2004

I ran into this very problem last night. I normally just throw a or two or three in there and call it good. Last night was no exception.

My assumption was also that for once IE was rendering correctly and FireFox was not. However, the official guidelines for CSS talk about the height property in block-level elements (ie Divs, among other things). It has this to say:

Quote: floating boxes and absolutely positioned boxes are ignored

Looks like Mozilla/Firefox is rendering it correctly again. That rule is just not what I would consider intuitive.

I pulled that quote from here:

http://www.w3.org/TR/CSS21/visudet.html#the-height-property

They have: 7 posts

Joined: May 2006

Adding P Tags just pushed the element down further (oh well). I bodged a solution. Why is CSS based design so complex eh? Thanks anyway!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.