htmlInline elements and block-level elements include: 1. Inline elements include a, span, strong, em, img, input, button, label, etc.; 2. Block-level elements include div, p, h1-h6, ul, ol, li, table, form, etc.; 3. There are a, span, img, etc. that are both inline elements and block-level elements. When "display: block;" is used, they will become block-level elements.
#The operating environment of this article: Windows 10 system, Dell G3 computer.
Elements in HTML can be divided into two types: inline elements and block-level elements. These two elements have different characteristics in page layout and display.
Inline Elements:
Inline elements will not occupy a row by default, they will be arranged horizontally on the same line. Inline elements only take up the space required by their content and do not force line wrapping.
Common inline elements are:
: Used to style or group inline elements in text.
: Text used to express emphasis.
: Used to represent italicized or emphasized text.
: used to insert images.
: used to create input fields.
Block Elements:
Block-level elements will occupy one line, and line breaks will be automatically added before and after. They will fill the width of their parent element as much as possible.
Common block-level elements are:
: used to define paragraphs.