The Display:inline-block in CSS

Source: Internet
Author: User

    • 1, Display:inline-block
    • 2. Inline-block in IE
    • 3. Other browsers
1, Display:inline-block

Allows an element to have the attribute of the chunk element (which can be set to width and height) and the property of an inline element (no wrapping is generated).

2. Inline-block in IE

IE6 does not support this property, but IE8 begins to support this property.

Inline-block characteristics of IE6 inline elements

Since Inline-block will trigger the layout of IE, as long as the IE6 set {display:inline-block;} Can.

There are two ways to let IE6 block elements have inline-block attributes.

A, you can trigger the layout, and then set to inline, it should be noted that the two display must be in two CSS declarations to be valid, the code is as follows:

div {    width:400px;    height:200px;    Display:inline-block;} div {    display:inline;}

B, directly set to inline, then use zoom to trigger layout to achieve similar effects:

div {    width:400px;    height:200px;    *display:inline;    *zoom:1;}

3. Other browsers

This property is supported by other browsers, but Firefox does not support this property until 3.0, and the previous version can use its private property {Display:-moz-inline-box} to achieve a similar effect. But you can also ignore versions prior to 3.0 (these versions of browsers are rarely used).

The Display:inline-block in CSS

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.