1 Floating problem

1, the default width B of block elements and block element A is 100% inside; after use of a float A, B for the width actually required width B, B is determined by the width A; B using the display: inline after -block width B B is actually required width, the width a remains 100%. 
2. A block-level elements do not float, wide aspect is not provided, which floating inside block element B, A cause collapse.
3, clear float
case: the parent element does not float, float sub-elements, lead to the collapse of the parent element.
Solution 1: parent element also float
solution 2: parent element fixed high
solution 3: parent element increases pseudo-earth elements, clear float
solution 4: parent element overflow: hidden
solution 5: parent element overflow: auto
solution 6: parent element display: table
7 solve: inside the parent element last increase an empty element, the style is clear: both

Guess you like

Origin www.cnblogs.com/gushixianqiancheng/p/10963891.html