IE6,IE7,IE8 CSS hacks 演示之 检测当前浏览器版本
2011-08-17 20:57
495 查看
这个样例比较系统的将IE6,IE7,IE8 CSS hacks方法应用出来。
<!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>
<title>CSS hacks for IE6, IE7, IE8</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css">
/*<![CDATA[*/
body {font: 28px/1 Arial, Tahoma, sans-serif; color: #666; padding: 20px;}
strong {color: #390}
h1 {font-size: 16px; font-weight: normal; margin: 80px 0}
#ie6, #ie7, #ie8 {display: none}
/* IE 6 */
* html #notie {display: none}
* html #ie6 {display: block}
/* IE 7 */
*+html #notie {display: none}
*+html #ie7 {display: block}
/* IE 8 */
#notie {display: none\0/}
#ie8 {display: block\0/}
/*]]>*/
</style>
</head>
<body>
<div id="notie">你的浏览器版本: <strong>非IE</strong></div>
<div id="ie6">你的浏览器版本: <strong>Internet Explorer 6</strong></div>
<div id="ie7">你的浏览器版本: <strong>Internet Explorer 7</strong></div>
<div id="ie8">你的浏览器版本: <strong>Internet Explorer 8</strong></div>
</body>
</html>
<!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>
<title>CSS hacks for IE6, IE7, IE8</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css">
/*<![CDATA[*/
body {font: 28px/1 Arial, Tahoma, sans-serif; color: #666; padding: 20px;}
strong {color: #390}
h1 {font-size: 16px; font-weight: normal; margin: 80px 0}
#ie6, #ie7, #ie8 {display: none}
/* IE 6 */
* html #notie {display: none}
* html #ie6 {display: block}
/* IE 7 */
*+html #notie {display: none}
*+html #ie7 {display: block}
/* IE 8 */
#notie {display: none\0/}
#ie8 {display: block\0/}
/*]]>*/
</style>
</head>
<body>
<div id="notie">你的浏览器版本: <strong>非IE</strong></div>
<div id="ie6">你的浏览器版本: <strong>Internet Explorer 6</strong></div>
<div id="ie7">你的浏览器版本: <strong>Internet Explorer 7</strong></div>
<div id="ie8">你的浏览器版本: <strong>Internet Explorer 8</strong></div>
</body>
</html>
相关文章推荐
- 针对IE6,IE7,IE8,IE9,FF等不同浏览器的CSS写法
- css javascript等兼容IE6,IE7,IE8,IE9,FIREFOX,Chrome等浏览器详细解决方法
- 如何让div+css兼容ie6 ie7 ie8 ie9和FireFox Chrome等浏览器
- IE6 IE7 IE8 FF浏览器的CSS兼容问题探究
- 黄聪:DIV+CSS建站经验总结,不同版本IE下CSS布局bug问题(IE5、IE6、IE7、IE8、火狐Firefox兼容)
- div+css 兼容ie6 ie7 ie8 ie9和FireFox Chrome等浏览器方法
- div+css 兼容ie6 ie7 ie8 ie9和FireFox Chrome等浏览器方法
- 2012-06-29 09:01 JS代码判断浏览器版本,支持IE6,IE7,IE8,IE9!
- JS代码判断浏览器版本,支持IE6,IE7,IE8,IE9!三种方法!
- IE浏览器版本检测并提示升级,IE6,IE7,IE8,IE9,IE10
- div+css 兼容ie6 ie7 ie8 ie9和FireFox Chrome等浏览器方法
- div+css 兼容ie6 ie7 ie8 ie9和FireFox Chrome等浏览器方法(原创理论)
- div+css 兼容ie6 ie7 ie8 ie9和FireFox Chrome等浏览器方法
- 谈IE浏览器的CSS兼容问题(IE6 IE7 IE8三大浏览器的CSS兼容速查表)
- ie6 ie7 ie8 共存以及Firefox浏览器CSS兼容写法
- JS代码判断浏览器版本,支持IE6,IE7,IE8,IE9!三种方法!
- IE6 IE7 IE8 FF浏览器的CSS兼容问题(转)
- IE6、IE7、IE8之IE多版本共存的几种方法(主要是为了测试css用)
- 浏览器兼容实例:css透明滤镜-完美兼容ie6,ie7,ie8以及firefox
- 如何让div+css兼容ie6 ie7 ie8 ie9和FireFox Chrome等浏览器