What is layout: The browser places elements in the correct position at the correct size.
Layout: The mode of placing elements.
CSS properties that affect the size and position of elements: display position float flex
display
Set the display mode of elements, including size and position. The values of display are:
block
inline
inline- block
none
display : block
block element is also called "block-level element"
display : inline
display: line features:
1. The default width is content Width
2. The width and height cannot be set, because the width and height cannot be set for row-level elements
3. Display in the same row. If both the preceding element and the subsequent element are display:inline (row-level elements), then they are displayed in the same row. It is possible to wrap lines inside elements.
Default display: inline elements span , a , label, cite , em, …
For example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|