Fully compatible with the CSS HACK wording IE6/IE7/IE8/FF

分类:Web 2010-04-11 来源:CodeWeblog.com 人气:529

Browser market chaos caused great trouble to designers, design pages compatible browsers have to complete this compatible with the browser, would have ie6 compatible with ff is easily among the solutions. Would be trouble spots with a ie7, ie8 even the appearance of headache, and not the original hack ie7 method can be used, how should we do?

The first method:

Fortunately, Microsoft provides such a code:

<meta http-equiv="x-ua-compatible" content="ie=7" />
<head> Put this code inside the page inside the ie8 ie7 resolution up Jiugen exactly the same, so basically you can ignore the ie8, rest of the code only needs to write on it

background: # ffc; / * effective against firefox * /
* Background: # ccc; / * on ie7 valid * /
_background: # 000; / * valid only for ie6 * /
Explain it:

firefox can parse the first paragraph, the latter two because preceded by a special symbol "*" and "_", firefox can not recognize, it only recognized background: # ffc, see is yellow;

ie7 can identify the first two short, to the last subject, so the final analysis is the background: # ccc, see is gray;

ie6 three sections can be identified, and "_" the only ie6 will recognize, the final resolution is _background: # 000, see is black

Amen! Already is the simplest and best understood of the wording, if you are coming in google, I can responsibly tell you that this method is ok, I've tested.

ie8 compatibility of that period of 7 I tested the code, and in my present windos 7 brought the ie8 beta no problem, since the official version of ie8 also control whether to use them do not know.

ps: If you find written by me, or have questions, please check your html head, take a look at the contents of <head> is not the case prior to the standard formulation

<! DOCTYPE html PUBLIC "- / / W3C / / DTD XHTML 1.0 Transitional / / EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<Html xmlns = " http://www.w3.org/1999/xhtml ">

This is now a fairly standard formulation, if the page you are using dreamweaver to do so, the default is of such norms, remember, this non-standard writing style, and compatibility can not guarantee

The second method:

Demanding friend is reluctant to increase the head of the page <meta http-equiv="x-ua-compatible" content="ie=7" /> such a code, because this result is that each page had to increase . To these so-compatible browsers really need to find another solution. Site released a day earlier "perfect compatible with ie6, ie7, ie8 and firefox's css transparent filters", may then test the negligence, IE8 does not solve the compatibility, a lot of friends responded that not take. Out some time today, A lot of information, finally solved the problem.

The following are compatible IE6/IE7/IE8/FF wording, note the following order can not be reversed

margin-bottom: 40px; / * ff attributes * /
margin-bottom: 140px \ 9; / * IE6/7/8 attributes * /
color: red \ 0; / * IE8 support * /
* Margin-bottom: 450px; / * IE6 / 7 of the properties * /
Following the form of an instance, we can run the code check effects

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>2010 The latest fully compatible with ie6, ie7, ie8, FF  CSS HACK Writing  --www.ietester.net</title>
<style type="text/css">
#abc {
 border:2px solid #00f;     /*ff Property  */
 border:2px solid #090\9;   /* IE6/7/8 Property   */
 border:2px solid #F90\0;     /* IE8 Support   */
 _border:2px solid #f00;     /*IE6 Property  */
 }
 /* Upper and lower order cannot write wrong  */
 </style>
</head>
<body>
<div>
  <ul>
    <li>FF Under the blue side  </li>
    <li>IE6 Under the Red edge  </li>
    <li>IE7 Under the Green edge  </li>
    <li>IE8 Under the yellow edge  </li>
    <li> Please mark to reprint  www.ietester.net</li>
  </ul>
</div>
</body>
</html>
分享到:
blog comments powered by Disqus

相关文章

  • CSS control the image geometric scaling (IE, GOOGLE browser, FIREFOX test) 2011-01-07

    CSS control the image geometric scaling (IE, GOOGLE browser, FIREFOX test) img { width: expression (this.width / this.height> 126/96? 126: (this.width * 96/this.height)); height: expression (this.width / this.height> 126/96? (this.width * 126/t

  • javascript支持firefox,ie7页面布局拖拽效果代码 2014-09-18

    javascript 拖拽 页面拖拽 拖拽效果的页面 超级拖拽 javascript支持firefox,ie7页面布局拖拽效果代码 鼠标拖拽 javascript 拖拽JavaScript Google IG Drag Demo,非常棒的拖动,准备用于F2Blog新Theme的后台模块设置,之间的拖 动 拖拽效果的页面效果演示地址:http://img.jb51.net/online/tuozhuai/google_drag.htm 加强版效果演示地址:http://img.jb51.net/o

  • DOCTYPE html PUBLIC js code so that part of the solution failure 2010-11-02

    Javascript call to a number of properties in the name of which has changed how I said the value of not document.body.scrollTop js script after taking time to document the value in question is estimated to get out of here ~ ~ Obviously the script using the

  • Firefox下的浏览器兼容性检测工具--Compatibility Detector 2014-03-10

    这里给大家推荐一个Firefox下的浏览器兼容性检测工具——Compatibility Detector。这个工具对于新手来说是非常不错的一个东东,下面我就简单说下它的优点。 作为一个前端开发者来说,最痛苦的事情之一就是要兼容现在各种五花八门的浏览器,而在实际的调试中这个调试过程又是让人劳心劳力。而Compatibility Detector能把目前很多已知的兼容性问题很easy的展现在我们面前。Compatibility Detector下有两种:基本检测和高级检测。 基本检测会检测一些基本的

  • Modify the source code, to achieve double-click close tab firefox 2010-11-20

    firefox chrome directory under the installation directory, locate the file browser.jar Open with winrar, find the content \ browser \ tabbrowser.xml use Notepad or any other tool to open a text editor <method name="onTabBarDblClick">

  • java IE Add to Favorites Firefox IE7 compatible browser status bar error, "Element not found" or "do not have permission" 2010-03-08

    The above code is correct. The browser reports the error encountered is: (1) browser status bar may not have permission to report the error: The reason is: if the page is not on the server (eg tomcat), but on the common folder (eg desktop), then the ...

  • javascript firefox and ie the difference between (solve compatibility must see) 2010-07-12

    Since firefox and ie the difference between the interpretation of the javascript, javascript code on led to compatibility problems: Document.form.item problem Existing problems: There are many existing code document.formName.item ("itemName") Th

  • Google Maps API Discussion 2010-04-29

    The following code can just replace the key string test using Results as shown below:

  • html code _js pop pop code, only to pop up again within 24 hours 2010-11-22

    html code _js pop pop code, only to pop up again within 24 hours. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <he

  • Configured + to run under Windows source code + AS3 connection red5 red5 simple example 2010-04-19

    Configured + to run under Windows source code + AS3 connection red5 red5 simple example Posted on 18 April 2010 Windows environment + configuration + run red5 source Red5 developed rapidly, the latest version is 0.9.1, and the previous version (0.8. +, 0.

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.197 (s). 12 q(s)