CSS different browser compatibility issues

Source: Internet
Author: User

IE5. X/win's resolution of Box-model is the same, they think that the width includes the border (border) and filler (padding), fortunately this situation in the IE6 has improved
but IE6 is backward compatible with the previous error, IE6 actually has two cores, in the old page he still shows the tolerance of the error, only in the document strictly with the document type (DOCTYPE) declaration, IE6 can accept the correct Box-model
So, Tantak hack must be included with the correct DOCTYPE in the document to work correctly
Quote
Div.content {
width:400px;//This is the wrong width, all browsers read
Voice-family: ""} ""; IE5. X/win ignored the contents of the ""} "" "
Voice-family:inherit
width:300px;//The part of the browser, including Ie6/win, reads this, and the new value (300px) overwrites the old
}
Html>body. Content {//html>body is CSS2 's writing
width:300px;//Support CSS2 The browser is fortunate to read this phrase
}
now back to the topic we often see! Important and (space)/**/: What's the secret of this writing, using the combination?

Look at that writing, I can provide another way to achieve this effect
Quote
div.content {
width:300px!important; This is the correct width, most browsers that support!important tags use the values here
Width (space)/**/:400px; Ie6/win does not parse this sentence, so Ie6/win still think the value of width is 300px, and Ie5.x/win reads this, the new value (400px) covers the old, because the!important tag doesn't work for them.
}
Html>body. Content {//html>body is CSS2 's writing
width:300px; The browser that supports CSS2 this writing is fortunate to have read this sentence
}
Again, this method must still rely on the correct document type declaration to work properly, as has been said before.

A document type declaration is like a switch that opens the backward-compatible future, and when used incorrectly, is a Pandora box

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.