Read css world record

Section 3.1:

Block elements corresponding English is: block-level element, there is a common div, li, table. But block elements "display-block" and is not a concept, such as the default display li element is list-item, table display the default value table. But they are block-level elements, they are consistent with the characteristics of the block-level element, i.e., a display element on a single horizontal flow, a plurality of block elements is shown with a line. It is because there are block-level elements characteristic line breaks displayed, so in theory they can influence with clear property to clear the float brings.

such as:

.clear:after{
     content:"",
     display: table | list-item | block
     clear:both; 
}    

The actual development, we use either block or use the table, do not use the list-item has the following three reasons:

1): easy to write.

2): you will not need bullets, no problem, you can add a line: list-style-type: none; to

3): IE (including IE11 of the) display browser does not support pseudo-element is list-item. Common elements set this property is valid, but the pseudo-element is not valid.

 

Guess you like

Origin www.cnblogs.com/tdd-qdkfgcs/p/11038907.html