Box Model-the relationship between the outer margin, the inner margin, and the border. What is the difference between the Box Model in browsers earlier than IE 8.
The layers of an element box model are from the inside to the outside: The inside margin, the border and the outside margin.
The width and height of the elements defined in the Box Model of the browser below IE8 do not include the padding and border
Block-level elements and intra-row elements-how to use CSS to control them, how they affect the surrounding elements, and how you think they should be defined.
Block-level elements. Use the display: inline In css. The attribute is changed to an element in the row.
The element in the row. Use the display: Block in CSS. The attribute is changed to a block-level element.
Impact: the surrounding elements are displayed in the same line or line feed. Adjust the style according to the actual situation.
Floating elements-how to use them, what problems they have, and how to solve them.
The float attribute in CSS can be used to define the floating position of an element. Left: float to the left, right: float to the right
Problems caused by floating elements:
(1) the height of the parent element cannot be extended, affecting the elements at the same level as the parent Element
(2) Non-floating elements at the same level as floating elements will follow
(3) If the first element is not floating, the elements before the element also need to be floating; otherwise, the structure displayed on the page will be affected.
Solution:
Using the clear: Both; attribute in CSS to clear the floating of elements solves the problems 2 and 3. For Issue 1, add the following style and add the Clearfix style to the parent element:
. Clearfix: After {content: "."; display: block; Height: 0; clear: Both; visibility: hidden ;}
. Clearfix {display: inline-block;}/* for IE/MAC */