2017-06-19 98 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”。我读过那个论坛是真的吗? –