Floated Child Elements: overflow:hidden or clear:both?

Dden overflow - pretty solid method. The main disadvantage is if you set a height on the parent element, any overflow will be...well, hidden. I found this when creating a menu with floated list items - the submenus would not appear.

Clearing element - rather than a line break, I would use a div with height: 0; clear: both; since it won't create a gap below. This is a more solid method, the only disadvantage being an extra element in the markup. Float the parent - in my experience there are too many situations where you don't want to float the parent element, so I would avoid it.

You can also use the generated content method: #parent:after { content: ". "; visibility: hidden; clear: both; } This saves the need for an extra element in the markup, but it won't work in IE7 and below. Use inline blocks - just remembered this method.

Instead of floating the two columns, set them to display: inline-block and they will appear side-by-side: . Child { display: inline-block; vertical-align: top; } Only thing you must remember with this method is if there is any whitespace between the close tag of one block and the opening tag of another, a space will appear between the columns (the size of which depends on the font so it difficult to gauge). As long as you do ...

4 is interesting. Haven't seen that before. – tybro0103 Apr 15 '10 at 19:34.

The second is totally unnecessary and adds extra markup. Just something else to go wrong. Use the first if it fits the bill.

You can also float the parent element to do the same thing though it might not fit what you're doing.

PPK discusses this in Clearing floats over on QuirksMode.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions