作家
登录

css兼容性CSS HACK 使用方法

作者: 来源: 2014-06-23 15:25:46 阅读 我要评论

 *属于css hack通配符,*代表的事ie8适用,_代表的是ie6适用,+代表的是ie7适用,位置如下_width:12px,而不是*s{width:12px};

<!DOCTYPE html>  
<html>
<head>
<title>Css Hack</title>
<style>
#test
{
width:300px;
height:300px;

background-color:blue; /*firefox*/
background-color:red9; /*all ie*/
background-color:yellow; /*ie8*/
+background-color:pink; /*ie7*/
_background-color:orange; /*ie6*/
}
:root #test { background-color:purple9; } /*ie9*/
@media all and (min-width:0px){ #test {background-color:black;} } /*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>
</html>

  推荐阅读

  兼容性CSS HACK 写法用法

@media screen and (-webkit-min-device-pixel-ratio:0){#mymain{left:-12px !important;}}>>>详细阅读


本文标题:css兼容性CSS HACK 使用方法

地址:http://www.17bianji.com/diaocha/34316.html

关键词: 探索发现

乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

网友点评
自媒体专栏

评论

热度

精彩导读
栏目ID=71的表不存在(操作类型=0)