Double margin bug of IE

Source: Internet
Author: User
If an edge is in the same direction as the float, when the margin is applied to the floating box on the edge, the margin under IE6 is doubled. We can use hack to solve this problem! HtmlCode:<! Doctype HTML>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> fixed the double margin bug in IE6 </title>
<Style type = "text/CSS">
Body {margin: 0; padding: 0}. Kuang {width: 300px; Height: 200px; Border: 1px solid #009933; float: Left; margin-left: 100px}
</Style>
</Head>
<Body>
<Div class = "Kuang"> Use hack to solve the double margin bug in IE6 </div>
</Body>
</Html> ========================================== ===== Solution: . Kuang {_ Display: inline;Width: 300px; Height: 200px; Border: 1px solid #009933; float: Left; margin-left: 100px}Add style: _ display: Inline for IE6 separately. Examples of browsers except IE6 (IE7, IE8, ie9, and Mozilla Firefox): Example of IE6:

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.