6 methods for clearing floating html, 6 methods for floating html
For details, click
Display: inline-block:
1. display block elements in one row
2. Enable embedded support for width and height
3. The line feed is parsed.
4. When not set, the width is opened by the content.
5. Block tags are supported in IE6 and 7.
Because the inline-block attribute is parsed (with gaps) When wrapping, the floating float: left/right method is used.
Usage of floating:
1. display block elements in one row
2. Enable embedded elements to support width and height
3. When the width is not set to a high value, the width is opened by the content.
4. line breaks are not parsed (floating can be used to clear gaps when using in-row elements)
5. when an element is added to the floating path, the object is moved away from the document stream and in the specified direction, until the parent-level boundary or another floating element is reached (the document flow shows the position of objects in the document when they are arranged)
Floating Method:
1. Float the parent level(In this case, when the parent-level margin: 0 auto; is not centered)
2. Add the display: inline-block; (same method 1, not centered) to the parent level. Only IE6 and 7 Center)
3. Add <div class = "clear"> </div> to the floating element.
4. Add <br clear = "all">
5. Add {zoom: 1;} to the floating element parent level ;}
: After {content: ""; display: block; clear: both ;}
6. Add overflow: auto to the floating element parent level;Source: http://www.jb51.net/article/43261.htm
For more html/css content, click