Apple新推出的iOS7操作系统导致视网膜媒体查询出现问题。
图像替换适用于运行iOS6及更低版本(任何浏览器)的iPhone 4,4s,5。 iOS7浏览器似乎抓住高分辨率图像但忽略背景大小属性。
我尝试使用“(min-device-pixel-ratio:2)”但是没有用,因为应用程序显示了我们的非视网膜精灵 - 任何人都有想法修复它?
@mixin sprite($x,$y, $spriteX: 32, $spriteY: 32, $imagePath: "sprites.png"){
@include spriteHelper($imagePath, $x, $y, $spriteX, $spriteY);
@media (-webkit-min-device-pixel-ratio: 2) and (min-device-pixel-ratio: 2)
{
$imagePath: "spritesx2.png";
background-size: 500px 1760px;
@include spriteHelper($imagePath, $x, $y, $spriteX, $spriteY);
}
}
答案 0 :(得分:2)
谢谢!我用背景大小的“!important”标签修复它
@mixin sprite($x,$y, $spriteX: 32, $spriteY: 32, $imagePath: "sprites.png"){
@include spriteHelper($imagePath, $x, $y, $spriteX, $spriteY);
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (-moz-min-device-pixel-ratio: 2),
only screen and (-o-min-device-pixel-ratio: 2/1),
only screen and (min-device-pixel-ratio: 2),
only screen and (min-resolution: 2dppx)
{
$imagePath: "spritesx2.png";
background-size: 500px 1800px !important;
@include spriteHelper($imagePath, $x, $y, $spriteX, $spriteY);
}
}