In CSS, tag elements in HTML can be divided into three types: block elements, inline elements, and inline block elements .
The most common block elements are:
<div>, <p>,
Features of blocky elements:
1, a block element exclusive row;
2, the block element height, width, bottom margin, Dingbian distance and row height can be set;
3, the width of the block element is not set in the case of its parent element of 100%.
The commonly used inline elements are:
<a>, <span>, <label>, <br>, <em>, <strong>, <i>, <q>, <var>, < Cite>, <code>
Features of inline elements:
1, and other elements in one line;
2, the height of the inline elements, width, bottom margin, Dingbian distance and row height can not be set;
3, the width of the inline element is that it contains the text or the width of the picture, it is not possible to change.
The commonly used inline block elements are:
, <input>
Converts an inline element to a block element write {Display:block} inside the CSS of the inline element to be converted
Converts a block element to an inline element write {display:inline} in the CSS of the block element to be converted
Converts an element to an inline block element write {Display:inline-block} in the CSS of the element to be converted
HTML Tag Element classification