![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a floated container that is breaking out of it's containing block. I don't remember the tricks to fix that (sorry Dorayme). |
#3
| |||
| |||
|
|
I have a floated container that is breaking out of it's containing block. I don't remember the tricks to fix that (sorry Dorayme). |
#4
| |||
| |||
|
|
I have a floated container that is breaking out of it's containing block. I don't remember the tricks to fix that (sorry Dorayme). Jeff |
#5
| |||||
| |||||
|
|
In article <QamdnTMcIKERG1vVnZ2dnUVZ_j6dnZ2d (AT) earthlink (DOT) com>, Jeff <jeff (AT) spam_me_not (DOT) com> wrote: I have a floated container that is breaking out of it's containing block. I don't remember the tricks to fix that (sorry Dorayme). Jeff Well, Jeff, perhaps you lost the link to my http://netweaver.com.au/floatHouse/ |
|
In the face page, see sections 6, 7 and 8. But, briefly (how I hate brevity): Use overflow: hidden or overflow: auto on the parent container. |
|
safest probably is to stick in a non floated child with a style="clear: both;" on it after the floats. That makes the parent sit up and listen even for IE6. |
|
IE6 where the parent does not grow height naturally for its floated children and it will not be forced to do so by overflow instructions. I recall it was you who brought this to my attention once! |
#6
| |||
| |||
|
|
Jeff schrieb: I have a floated container that is breaking out of it's containing block. I don't remember the tricks to fix that (sorry Dorayme). Here's what I use: --- common.css --- #container:after { clear: both; display: block; height: 0; content: "."; visibility: hidden; } --- ie.css --- #container { zoom: 1; height: 1px; he\ight: auto; } |
|
--- page.html --- link rel="stylesheet" media="all" type="text/css" href="common.css" !--[if IE]><link rel="stylesheet" href="ie.css"><![endif]-- For standard compliant browsers supporting the content property, we simply add an additional block at the end of #container and have it clear the float. IE does not support the content property, but has a proprietary internal property called "layout". If this is set, a side effect will be that all floated children will be enclosed by their #container. To set it (can't be done directly), use either the proprietary zoom property or assign a height. The above solution caters for IE5 and above. |
|
Greetings, Thomas |
![]() |
| Thread Tools | |
| Display Modes | |
| |