2017-06-19 125 views
-1

我正在使用幾個媒體查詢,以橫向和縱向爲目標的iPad和iPhone,但截至iOS 7,他們不再工作。不過,他們在iOS 6中完美工作。有沒有人有過類似的經歷?iphone7的媒體查詢

+2

發佈您正在使用的媒體查詢克,也許? – obskyr

回答

0

確保您的iPad查詢前已關閉所有媒體查詢和媒體資源。下面是兩個查詢的一個例子,我用它來確定iPad和方向:

@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) {} 

@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape){} 
0

你應該試試這個:

//iPhone 7 in portrait & landscape 

@media only screen 
and (min-device-width : 375px) 
and (max-device-width : 667px) { /* STYLES GO HERE */} 

//iPhone 7 in landscape 
@media only screen 
and (min-device-width : 375px) 
and (max-device-width : 667px) 
and (orientation : landscape) { /* STYLES GO HERE */} 

//iPhone 7 in portrait 
@media only screen 
and (min-device-width : 375px) 
and (max-device-width : 667px) 
and (orientation : portrait) { /* STYLES GO HERE */ } 

而對於iPhone 7加:

//iPhone 7 Plus in portrait & landscape 
@media only screen 
and (min-device-width : 414px) 
and (max-device-width : 736px) { /* STYLES GO HERE */} 

//iPhone 7 Plus in landscape 
@media only screen 
and (min-device-width : 414px) 
and (max-device-width : 736px) 
and (orientation : landscape) { /* STYLES GO HERE */} 

//iPhone 7 Plus in portrait 
@media only screen 
and (min-device-width : 414px) 
and (max-device-width : 736px) 
and (orientation : portrait) { /* STYLES GO HERE */ } 
+0

我用上面的媒體查詢,但在移動設備的任何更改。會做什麼? 「https://stackoverflow.com/questions/18952156/media-queries-in-ios-7-not-working」。我讀過那個論壇是真的嗎? –