不同浏览器的样式兼容

.main_ul li:hover
{
background: #666;/*标准浏览器*/
background: purple\0;/*IE8、IE9,opera*/
*background: #6d6d6d;/*IE7及IE6*/
_background:#f8f8f8;/*IE6专属*/
}
/*IE9专属*/
:root .main_ul li:hover
{
background: #fdfdfd\9;
}
/*谷歌专属*/
@media screen and (-webkit-min-device-pixel-ratio:0)
{
.main_ul li:hover
{
background: red;
}
}
/*火狐专属*/
@-moz-document url-prefix()
{
.main_ul li:hover
{
background:yellow;
}
}
/*opera专属*/
@media all and (-webkit-min-device-pixel-ratio:10000),not all and (-webkit-min-device-pixel-ratio:0)
{
.main_ul li:hover
{
background: green;
}
}

posted @ 2017-02-21 23:06  LamWei  阅读(218)  评论(0编辑  收藏  举报