Html element types: block-level elements, inline elements (also called intra-row elements), and inline block-level elements ., Element inline
Tag elements in html are generally divided into three types: block-level elements, inline elements (also called intra-row elements), and inline block-level elements.
Block-level element features:
1. Each block-level element starts from a new row, and the subsequent element also starts from another row. (Overlord, a block-level element excludes one row)
2. You can set the height, width, row height, and top and bottom margins of an element.
3. If the element width is not set, it is 100% of its parent container (consistent with the width of the parent element)
Common block elements include:
<Div>, <p>,
Set display: block. You can convert an element into a block-level element.
Inline element features:
1. and other elements are on one row;
2. The height, width, and top and bottom margins of the element cannot be set;
3. The width of an element is the width of the text or image it contains and cannot be changed.
Common inline elements include:
<A>, <span>, <br>, <I>, <em>, <strong>, <label>, and <q>
Set display: inline. Block elements can be converted to inline elements.
Inline block-level element features:(Both inline and block-level elements are available)
1. and other elements are on one row;
2. You can set the height, width, row height, and top and bottom margins of the element!
Commonly used inline block elements include:
, <input>
Display: inline-block; float: left/right; position: absolute/fixed; you can set the element to an inline block-level element.