我遇到了我的精靈問題。我的問題是我有一個菜單精靈,以及視網膜菜單精靈。但由於某種原因,視網膜精靈的Css不起作用。這裏是我的代碼:Retina-Sprite CSS不起作用
@media only screen and (-webkit-min-device-pixel-ratio: 2.0),
only screen and (min--moz-device-pixel-ratio: 2.0),
only screen and (-o-min-device-pixel-ratio: 200/100),
only screen and (min-device-pixel-ratio: 2.0) {
.menu li a,
background-image:url('images/[email protected]');
-webkit-background-size: 110px 55px;
-moz-background-size: 110px 55px;
background-size: 110px 55px;
}
現在,這裏的普通導航精靈:
.menu li a{background: url('images/sprite-nav.png') no-repeat;width: 100%;height: 100%;display:block;}
.menu li.services{width: 110px;height: 55px;}
.menu li.services a{background-position: 0px -300px;}
.menu li.services a:hover{background-position: 0px 0px;}
順便說一句,在菜單中有一個以上的圖像(例如我只需添加更多的菜單裏的,代之以「服務」下一個菜單項。)
對不起,我不能上傳到jfiddle,因爲我不熟悉它。 所有答案讚賞!
使用嘗試僅僅'@media只有屏幕和(-webkit分鐘設備像素比:2),只有屏幕和(最小 - 裝置 - 像素比:2){'在你的樣式表中。 – MacMac 2013-03-13 22:52:28
試過,它沒有工作:( – Tycoon 2013-03-13 23:12:24