Home  >  Article  >  Web Front-end  >  What are the values ​​of the display attribute in h5

What are the values ​​of the display attribute in h5

百草
百草Original
2023-11-14 13:46:061381browse

The values ​​of the display attribute in h5 include block, inline, inline-block, none, table, flex, grid, list-item, inherit, initial, etc. Detailed introduction: 1. block, use the block value to make the element display at the block level, that is, the element will occupy an exclusive line, and the width defaults to 100% of the parent container; 2. inline, use the inline value to make the element display inline, that is, the element will not Exclusive line and so on.

What are the values ​​of the display attribute in h5

The operating system for this tutorial: Windows 10 system, DELL G3 computer.

In HTML5, the display attribute is used to control how elements are displayed. It defines how elements are laid out and presented on the page. The display attribute can take on a variety of values. Some of the common values ​​will be introduced below.

1. block (block-level element): Use the block value to display the element at the block level, that is, the element will occupy an exclusive line, and the width defaults to 100% of the parent container. Common block-level elements include

,

,

to

, etc.

2. inline (inline element): Use the inline value to display the element inline, that is, the element will not occupy a line by itself, but will be displayed in the same line as other elements. Common inline elements include , , , , , etc.

3. inline-block (inline block-level element): Use the inline-block value to display the element in an inline block-level manner, that is, the element is displayed in the same line, and attributes such as width and height can be set. Common inline block-level elements include ,