<!DOCTYPE html>
<html>
<head>
<title>Css Hack</title>
<style>
<html>
<head>
<title>Css Hack</title>
<style>
#test
{
{
width:300px
height:300px; ;
background-color:blue; /*firefox*/
background-color:red\9; /*all ie*/
background-color:yellow\0; /*ie8*/
+background-color:pink; /*ie7*/
_background-color:orange; /*ie6,顺序很重要*/
}
:root #test { background-color:purple\9; } /*ie9*/
@media all and (min-width:0px){ #test {background-color:black\0;} } /*opera*/
@media screen and (-webkit-min-device-pixel-ratio:0){ #test {background-color:gray;} } /*chrome and safari*/
</style>
</head>
<body>
<div id="test">test</div>
</body>
</head>
<body>
<div id="test">test</div>
</body>
</html>
网上down下来的资源,贡献给大家。也给自己保存着。其中有些hack之间的顺序是很重要的,否则会出现混乱的情况
本文提供了一个关于 CSS Hack 的实际应用案例,展示了如何通过特定的语法让样式仅应用于某些浏览器,如 IE、Firefox、Chrome 和 Safari 等,以此解决跨浏览器兼容性问题。
1002

被折叠的 条评论
为什么被折叠?



