In-depth understanding of display attributes-common important attributes of front-end layout, and in-depth understanding of display

Source: Internet
Author: User
Tags unsupported

In-depth understanding of display attributes-common important attributes of front-end layout, and in-depth understanding of display

Note: The display attribute is very common in web page layout, but it is often used only a few attribute values, such as block, inline-block, inline, And none. I will introduce each aspect of the display attribute in detail below.

Definition

The display attribute specifies the box type generated by the element and affects the display mode.

Common Values: none | inline | block | inline-block | list-item

Initial Value: inline

Apply to: All elements

Inheritance: None

[Note] IE7-the browser does not support table attribute values and inherit

Classification block

[Features]

[1] If no width is set, the width is the width of the parent element.

[2] exclusive row

[3] Support for width and height

[Unsupported style]

[1] vertical-align

Inline

[Features]

[1] Open Content width

[2] A non-exclusive row

[3] width and height are not supported

[4] code line breaks are parsed into spaces

[Unsupported style]

[1] background-position

[2] clear

[3] clip

[4] height | max-height | min-height

[5] width | max-width | min-width

[6] overflow

[7] text-align

[8] text-indent

[9] text-overflow

Inline-block

[Features]

[1] when no width is set, the content is opened

[2] A non-exclusive row

[3] Support for width and height

[4] code line breaks are parsed into spaces

[Unsupported style]

[1] clear

None

[Features]

Hide elements and exit document flow

List-item

[Features]

[1] when no width is set, the width is full

[2] exclusive row

[3] Support for width and height

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.