1. Block-level elements distinguish block-level elements from row elements:
- Block-level elements always appear on one line, rejecting other elements from the same line;
- The line height of block-level elements and the internal and external margins can be directly controlled;
- It can accommodate inline elements and other elements;
Line element:
- can be in line with other elements;
- Height and margin cannot be set directly (can be set by Display:inline-block/block);
- Width is its text and the width of the picture can not be changed (left and right margin/padding valid, upper and lower invalid;);
- Inline elements can only hold text and other inline elements
The fundamental difference between 2.relative and absolute: The former is out of the document flow, while the latter is not. 3. Learn some New tricks
A. The Layout-flow attribute has two values: horizontal (font level setting), Vertical-ideographic (vertical lines display);
B. Box-sizing:border-box;content-box; The emphasis is on how the actual size of the box is calculated. The former padding and margin are included, while the latter's actual width is =padding+margin+border+content;
C. Small icons and text alignment (set negative values)
img{vertical-align:-10px;}
HTML and CSS Learning notes