What are the various clearing techniques and which is appropriate for what context?
Importance
Low
Quiz Topics
CSS
- Empty
divmethod:<div style="clear:both;"></div>. - Clearfix method: Refer to the
.clearfixclass above. overflow: autooroverflow: hiddenmethod: Parent will establish a new block formatting context and expand to contains its floated children.
In large projects, having a utility .clearfix class will be very helpful. overflow: hidden might clip children if the children is taller than the parent and is not very ideal.