Commonly used block-level elements in HTML include:
- : defines a separated block in the document, usually as CSS Layout container.
: Define a paragraph, which will automatically wrap lines and add paragraph spacing.
- and
- : Define unordered lists and ordered lists. Each list item is a block-level element.
- : Define list items, which must be contained in
- or
- .
~
: Define the title, where
is the highest-level title.
- Semantic tags such as
, In addition, HTML also has some semantic tags, such as
, , etc., which are also block-level elements. It should be noted that by setting display: inline-block; in CSS, some block-level elements can be converted into inline block elements, thereby achieving a more flexible layout effect.
Commonly used inline elements include:
- : defines a small part of the text, usually used to set the text style (such as color, font, etc.) or used as a wrapper Other markers.
- : Defines a hyperlink, which can contain other inline elements or block-level elements.
- and : used to indicate emphasized and italicized text respectively.
- : Defines the image, which is an empty tag with no closing tag.
- : Define form controls for user input, including multiple types (such as text boxes, radio boxes, check boxes, etc.), which are usually styled through CSS.
In addition, there are some inline block elements, such as