DIV floating IE text produces 3 pixel bug

Source: Internet
Author: User

DIV floating IE text produces 3 pixel bug

Description: DIV floating IE text generates a 3-pixel bug. The left object is floating on the right side. The left margin of the outer patch is used to locate the bug. The right object (div) is separated by 3 px on the left.

Recurrence: A 3-pixel bug occurs when the text mode is set to miscellaneous in the developer tool.

Tested browsers: IE7 and IE8

How can we distinguish between the standard and weird modes of browsers?
 
The standard mode is added, but the odd mode (Miscellaneous mode) is removed );
Call the following JS Code to determine the mode:
 
 
 
Lele.log(window.top.doc ument. compatMode); // BackCompat indicates the odd mode. // CSS1Compat indicates the standard mode.

CSS:

# Box {width: 600px; height: 100px; margin: 100px auto; background: blue; }# left {float: left; width: 50%; height: 100px; background: red ;}# right {width: 100%; height: 100px; background: yellow;} * html # left {margin-right:-3px; /* The above sentence is important */}

HTML:
1 | 2 without margin-left:-3px, the effect is: 

The effect of adding margin-left:-3px is:

What does the last selector * html in the CSS style sheet mean?

I tested it in ie8 ie7 browser. When the text mode is set to miscellaneous, * html should be used

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.