gpt4 book ai didi

ios7 媒体查询(视网膜背景大小)

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:10:51 25 4
gpt4 key购买 nike

Apple 新的 iOS7 操作系统导致视网膜媒体查询出现问题。

图像替换在运行 iOS6 及以下版本(任何浏览器)的 iPhone 4、4s、5 上完美运行。 iOS7 浏览器似乎抓取高分辨率图像但忽略背景大小属性。

我尝试使用“(min-device-pixel-ratio: 2)”但不起作用,因为应用程序显示了我们的非视网膜 Sprite ¿任何人有解决它的想法?

@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);
}
}

最佳答案

非常感谢!我用背景大小的“!重要”标签修复它

@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);
}
}

关于ios7 媒体查询(视网膜背景大小),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18965770/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com