| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
css is for divs
Join Date: Feb 2003
Location: Norwich
Posts: 4,527
|
DIV height Mozilla/FF
Can't remember this one, it's Monday morning, was wondering if any clever people could help me out. Containing DIV has no set height so should be the height of the content within it. Works fine in IE but has no height in Mozilla. Sure I've sorted this before but can't get my head in gear this morning. TIA |
|
|
|
|
|
#5 (permalink) |
|
Not A Designer
Join Date: Jul 2004
Location: tHe NeTHerLaNDs
Posts: 122
|
This works, although it has 1px extra height in FF. <div style="clear: both"></div> No need for content. I think setting display to none would work but IMHO it's wrong. Display: none would remove the div from the flow entirely - so I don't think it should clear then. -= In theory, theory should work in practice. =-
|
|
|
|
#8 (permalink) |
|
css is for divs
Join Date: Feb 2003
Location: Norwich
Posts: 4,527
|
Ha ha, yes I'm good at confusion. Ok then here's a stripped-down version with the same issue. In IE the dark blue box has everythign inside it, this is what is supposed to happen. In FF however, the containing DIV just sits at the top as if nothing is inside it. (the css is here) |
|
|
|
#9 (permalink) |
|
Not A Designer
Join Date: Jul 2004
Location: tHe NeTHerLaNDs
Posts: 122
|
Use the footer to clear (in the footer, set clear: both). If you don't want a footer, create an empty div at the same place like so: <div style="clear:both"></div> However, if you're planning to do columns, you may want to look at faux columns at alistapart. A lot easier. [edit] maybe not so much easier, but more flexible and fun - you can create really nice effects with it [/edit] -= In theory, theory should work in practice. =-
|
|
|
|
#14 (permalink) |
|
css is for divs
Join Date: Feb 2003
Location: Norwich
Posts: 4,527
|
Ahah, by the time I'd posted that last reply there were the posts about the float:left - removed that (and taken out the unecessary overflow: hidden; from the container DIV) and it does indeed work. Thanks again. |
|
![]() |