Browser market chaos, to the designer caused a lot of trouble, the design of the page is compatible with the browser is compatible with that browser, originally IE6 and Firefox compatibility is easy to solve. Add a IE7 will trouble point, the appearance of IE8 more headaches, the original HackIE7 method can not be used, how to do it.
The first method:
Fortunately, Microsoft has provided such a code:
<metahttp-equivmetahttp-equiv= "x-ua-compatible" content= "ie=7"/>
Put this piece of code into
Background: #Firefoxc;/* valid for Firefox */*background: #ccc;/* Valid for IE7 */_background: #000;/* Only valid for IE6 */
Explain it:
Firefox can parse the first paragraph, the following two because the front added a special symbol "*" and "_", Firefox does not recognize, so only recognize background: #Firefoxc, see the yellow color;
IE7 before two short can recognize, with the final, so the final resolution is background: #ccc, see is gray;
IE6 Three can be recognized, and "_" This only IE6 can recognize, so the final resolution is _background: #000, see is black
is already the simplest and best understanding of the wording, if you are Google come in, I can be very responsible to tell you, this method is OK, I tested.
IE8 that part of the code compatible with 7 I have also tested, in my current Windos7 beta version of the IE8 is no problem, and later IE8 official version out of the tube no matter what you do not know.
PS: If you find that I have a problem with this, please check your HTML header to see if the content of
<! Doctypehtmlpublic "-//w3c//dtdxhtml1.0transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
This is now a comparative specification of the wording, if you are using Dreamweaver to do the page, the default is this specification, remember, non-standard wording, compatibility does not guarantee
The second method:
Demanding friends are reluctant to add <metahttp-equiv= "x-ua-compatible" content= "ie=7"/> to the page header, because the result is that each page is added. There are other ways to be compatible with these browsers. Early days of the site released a "perfect compatible with IE6,IE7,IE8 and Firefox CSS transparent filter", may be the test of negligence, IE8 compatibility has not been resolved, many friends replied that can not be used. Taking some time today and looking through a lot of information, we finally solved the problem.
The following is a compatible Ie6/ie7/ie8/firefox notation, note that the following order is not reversed
Properties of Margin-bottom:40px;/*firefox */MARGIN-BOTTOM:140PX\9;/*IE6/7/8 Properties */COLOR:RED\0;/*IE8 support */*margin-bottom:450px ;/*ie6/7 's Properties */