background-size:cover似乎在iPhone 3上不起作用。我在某个地方读到,使用background-size:100%;可以解决问题,而且它确实解决了这个问题。然而,这使得Iphone 4的背景看起来很难看。
我在互联网上搜索过,但我发现的都是对iPhone3和4的查询。是否只有Iphone 3有媒体查询?
编辑:我在下面的答案中发布了我的解决方案
发布于 2014-01-16 08:49:57
我找到了解决问题的办法。
这篇博客文章有一个特定iPhone版本的媒体查询列表。
<!-- iPhone 2G, 3G, 3GS Portrait -->
@media only screen and (device-width: 320px) and (orientation: portrait) and not (-webkit-min-device-pixel-ratio: 2) {
/* CSS3 Rules for iPhone in Portrait Orientation */
}
<!-- iPhone 2G, 3G, 3GS Landscape -->
@media only screen and (device-width: 480px) and (orientation: landscape) and not (-webkit-min-device-pixel-ratio: 2) {
/* CSS3 Rules for iPhone in Landscape Orientation */
}正如你所看到的,它的目标只有3GS。
https://stackoverflow.com/questions/21156321
复制相似问题