惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

K
Kaspersky official blog
Engineering at Meta
Engineering at Meta
D
DataBreaches.Net
Stack Overflow Blog
Stack Overflow Blog
Microsoft Security Blog
Microsoft Security Blog
Y
Y Combinator Blog
B
Blog RSS Feed
GbyAI
GbyAI
P
Proofpoint News Feed
aimingoo的专栏
aimingoo的专栏
MyScale Blog
MyScale Blog
D
Docker
阮一峰的网络日志
阮一峰的网络日志
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Recorded Future
Recorded Future
美团技术团队
The Register - Security
The Register - Security
V
Visual Studio Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
The Blog of Author Tim Ferriss
博客园 - 司徒正美
量子位
B
Blog
F
Fortinet All Blogs
Martin Fowler
Martin Fowler
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
A
About on SuperTechFans
I
InfoQ
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
雷峰网
雷峰网
大猫的无限游戏
大猫的无限游戏
J
Java Code Geeks
L
LangChain Blog
Latest news
Latest news
S
SegmentFault 最新的问题
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Blog — PlanetScale
Blog — PlanetScale
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cisco Talos Blog
Cisco Talos Blog
F
Full Disclosure
C
Cisco Blogs
D
Darknet – Hacking Tools, Hacker News & Cyber Security
W
WeLiveSecurity
T
Tenable Blog
T
Tor Project blog

博客园 - 爽爽

印章规格(2) 巧妙自制ps笔刷 当float遇到clear和clip 网站变黑白灰色的4种代码(转载) 15个CSS常识 CSS网页布局编码小技巧整理(转帖资料) word-break:break-all和word-wrap:break-word 自动换行问题 IE下神奇的一个Bug! 网页设计师的苦衷 ul li实现table - 爽爽 - 博客园 基于栅格系统的web设计——灵与魂的融合 [欣赏] 2008年logo设计趋势 出水芙蓉——网页中的广告位 汗~注释也能影响兼容?!—css中遇到的变态问题 常用图片格式全解(收藏~转) 网页设计标准尺寸(文章很实用~转) 我拿青春赌明天!后果我自负~ 什么教学海无涯! 继续学习adobe Illustrator之泡泡字体
兼容IE6/IE7/IE8/FireFox的CSS hack - 爽爽 - 博客园
爽爽 · 2009-04-16 · via 博客园 - 爽爽

<!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>区别IE6、IE7、IE8、FireFox的CSS hack</title>
<style type="text/css">
<!--
#test,#note{
 margin:0 auto;
 text-align:center; 
}
.note{ text-align:left; text-indent:40px;}
#test {
 width:200px;
 height:30px;
 border: 1px solid #000000;
 color:#fff;
 line-height:30px;
}
.color{
 background-color: #CC00FF;  /*所有浏览器都会显示为紫色*/
 background-color: #FF0000\9; /*IE6、IE7、IE8会显示红色*/
 *background-color: #0066FF;  /*IE6、IE7会变为蓝色*/   
 _background-color: #009933;  /*IE6会变为绿色*/
}
-->
</style>
</head>

<body>
<div id="test" class="color">测试方块 zss</div>
<div id="note">
 <strong style="color:#009933">IE6 最终为绿色</strong>
 <strong style="color:#0066FF">IE7 最终为蓝色</strong>
 <strong style="color:#FF0000">IE8 最终为红色</strong>
 <strong style="color:#CC00FF">FireFox 最终变为紫色</strong>
    <div class="note">
    今天看到hiccblogs里面一个关于IE8的兼容,一句话很简单,可惜只是针对IE兼容的,而且是建立在IE7的核心之上,局限性很大。自认为css兼容做的相对比较熟练,既然出了IE8,那就把IE8的兼容也研究一下。
    </div>
 <div class="note">CSS兼容性一直是大家头疼的问题,IE6、IE7和FF已经让大家够呛,在以前的文章中,很多这方面的知识介绍。IE8正式版发布以来,就想在找一种区别IE8正式版的方法.在百度搜索有很多个结果,google搜索的结果更多。IE8正式版和测试版在hack上是有很大区别的.而且网络上的方法几乎都是相互转载,出现频率最高的要数那张linxz.cn的hack图片了,可惜这张图里的方法对IE8正式版无效。
  经过分析和总结,有了下面的行之有效的解决方案,或许以后还会有更好更简单的hack,但就目前来说这个方法可以解决燃眉之急.<br />
  
</div>
 
   
 <div class="note">
 <ul>
<li style="list-style:none;"><strong style="color:#009933">Simple Example:</strong></li>
<li>"\9" 例:"margin:0px auto\9;".</li>
<li>这里的"\9"可以区别所有IE和FireFox.</li>
<li>"*" IE6、IE7可以识别.IE8、FireFox不能.</li>
<li>"_" IE6可以识别"_",IE7、IE8、FireFox不能</li>
</ul>
  </div> 
   
</div>
</body>
</html>