First, HTML tags include block-level elements (blocks), inline elements (inline)
1, block-level elements
Generally used to build Web site architecture, layout, hosting content ... It includes the following tags:
Address, blockquote, center, dir, Div, DL, DT, DD, fieldset, form, H1~h6, HR, Isindex, menu, Noframes, NoScript,
OL, p, Pre, table, UL
2. Embedded elements
Some of the details or parts of the site are generally used to "emphasize, differentiate style, superscript, subscript, anchor" and so on, these tags are embedded elements:
A, ABBR, acronym, B, BDO, big, BR, cite, code, DFN, EM, font, I, IMG, input, KBD, label, Q, S, Samp, select,
Small, span, strike, strong, sub, SUP, textarea, TT, U, var
Ii. nested rules for HTML tags
1. Block elements can contain inline elements or some block elements, but inline elements cannot contain block elements, which can contain only other inline elements:
<div>
<a href= "#" ><span></span></a>--to
<span><div></div></span>--wrong
2. Block-level elements cannot be placed in <p>:
<p><ol><li></li></ol></p>--wrong
<p><div></div></p>--wrong
3. There are several special block-level elements that can contain only inline elements and no longer contain block-level elements, which are the following special tags:
H1, H2, H3, H4, H5, H6, p, DT
4. Li can contain div tags-this one is not necessarily listed separately, but many people on the internet have some doubts about it, here slightly explain:
Both Li and div tags are containers for loading content, with equal status and no rank (e.g. H1, H2, hierarchical hierarchy ^_^)
, you know, Li Tag even its parent UL or OL can be accommodated, why would someone think Li just can't fit a div?
Do not see Li so stingy, don't look at Li is very small, in fact, Li is very broad-minded.
5. Block-level elements are tied to block-level elements, inline elements and inline elements:
<div>
<div><a href= "#" ></a><span></span></div>--to
<div>
Nested rules for HTML tags