In CSS, tag elements in HTML are broadly divided into three different types: block elements, inline elements (also called inline elements), and inline block elements. In HTML and XHTML, block-level elements cannot inherit inner elements (that is, they cannot be nested within inline elements), <p>i like <em>it</em></p> is the correct notation, but <em>i like <p>it</p></em> is not correct.
The most common block elements are:
<div>, <p>,
The commonly used inline elements are:
<a>, <span>, <br>, <i>, <em>, <strong>, <label>, <q>, <var>, < Cite>, <code>
The commonly used inline block elements are:
, <input>
* Can be set to display:block display inline elements as block-level elements. block elements can also display:inline be set to inline elements by code .
* Block-level element features:
1. Each block-level element starts with a new line, and the subsequent element also begins a row.
2, the height of the element, width, row height, and the top and bottom margin can be set.
3, the element width is not set, is its own parent container of 100% (and the width of the parent element consistent), unless a width is set.
* Inline Element Features:
1, and other elements are on one line;
2, the height of the element, the width and the top and bottom margin is not set;
3. The width of the element is the width of the text or Picture it contains, and it cannot be changed.
Inline block elements (Inline-block) are features that have inline elements, block elements, and code that display:inline-block sets elements as inline block elements
* Inline block Element element features:
1, and other elements are on one line;
2, the height of the element, width, row height, and the top and bottom margin can be set.
css--base block-level elements and inline elements