0
background-size:cover
似乎不適用於iPhone 3.我讀過的地方,使用background-size:100%;
應該解決問題,它確實。但是,它使Iphone 4的背景看起來很醜。是否有iPhone 3特定的媒體查詢?
我在互聯網上搜索,但我找到的都是查詢Iphone 3和4.是否有媒體查詢只是iPhone 3?
編輯:我下面貼
background-size:cover
似乎不適用於iPhone 3.我讀過的地方,使用background-size:100%;
應該解決問題,它確實。但是,它使Iphone 4的背景看起來很醜。是否有iPhone 3特定的媒體查詢?
我在互聯網上搜索,但我找到的都是查詢Iphone 3和4.是否有媒體查詢只是iPhone 3?
編輯:我下面貼
我在答案的解決方案,我發現我的問題的解決方案。
This blog post有一個針對特定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爲目標。
iPhone 3?你的意思是iPhone 3G/3Gs或iOS 3? – rckoenes
我的意思是3G/3GS,但我解決了這個問題,發現一篇博客文章,列出了針對不同iPhone的媒體查詢。 –