Home >Web Front-end >CSS Tutorial >What are the values ​​of display in css

What are the values ​​of display in css

下次还敢
下次还敢Original
2024-04-28 13:42:14646browse

Display attribute value defines the display form of the element in the document: Block: Block element, occupying the entire line width, can contain inline elements. Inline: Inline elements can only set the width and cannot contain block elements. Inline-block: combines the characteristics of block elements and inline elements, and can include inline elements. None: Hides the element and no longer occupies document space. Flex: A scalable container that controls element arrangement and size. Grid: Grid layout, which can create a layout with multiple columns and multiple rows. Table: Table element, consisting of table header, table body and table foot.

What are the values ​​of display in css

Display attribute value in CSS

The Display attribute defines how the element appears in the document and determines how the element behaves. show. It has the following main values:

1. Block

  • Block element, occupying the width of the entire row
  • You can set the height and width
  • Can contain inline elements

2. Inline

    ##Inline elements do not occupy the entire line
  • Only the width can be set, but the height cannot be set
  • Cannot contain block elements

3. Inline-block

    combined Characteristics of block elements and inline elements
  • Occupy the width of part of the line
  • You can set the height and width
  • Can contain inline elements

4. None

    Hidden elements
  • Elements no longer occupy space in the document
##5. Flex

Scalable container, used to allocate space between elements
  • Can control the arrangement and size of elements
6 . Grid

Grid layout, used to create multi-column and multi-row layouts
  • Can control the position and size of elements
7. Table

Table element, used to display data
  • It consists of table header, table body and table foot
Other values:

run-in
  • list-item
  • table-cell
  • table-column-group
  • table-column
  • table-footer-group
  • table-header-group
  • table-row
  • table-row-group

The above is the detailed content of What are the values ​​of display in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn