Display: inline-block in IE6 implement {transfer}

Source: Internet
Author: User

1. IE6/7 does not recognize inline-block, but triggers layout, which is the same as true.
2. IE6/7 does not fully support inline-block and is only valid for inline elements.

 

How can I implement the display: inline-block effect for block elements in IE?
There are two methods:
1. Use the display: inline-block attribute to trigger the block element first, and then define the display: inline, let the block element be presented as an inline object (two displays must be placed in two CSS declarations to achieve the effect, which is a classic bug in IE. If the display: inline-block is defined first, then set the display back to inline or block, and layout will not disappear ). The Code is as follows (... Is omitted from other attributes ):
Div {display: inline-block ;...}
Div {display: inline ;}
2. Set the block element to inline object submission (set the attribute display: inline), and then trigger the layout of the block element (for example, Zoom: 1 ). The Code is as follows:
Div {display: inline; ZOOM: 1 ;...}

 

The final problem can be solved as follows:

. Nav {text-align: center ;}

. Nav ul {display: inline-block! Important; * display: inline; ZOOM: 1; margin: 0; padding: 0 ;}

Display: inline-block! Important; can be implemented in FF, IE7 and later browsers because they support;

* Display: inline: enables IE6 to keep the row elements. Zoom: 1 triggers layout of IE6 to achieve the display: inline-block effect.

Display: inline-block in IE6 implement {transfer}

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.