Fre*_*xuz 3 media-queries ios7
它有什么办法吗?或者我们应该责怪苹果?
注意:此问题仅在应用程序模式下发生,而不是在常规Safari浏览模式下.它在iOS6中运行良好.
码:
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<style>
body {
color: blue;
}
@media (orientation:landscape) {
body {
color: red;
}
}
</style>
<body>
<h3>this text will go red when in landscape</h3>
<input type="text" />
</body>
Run Code Online (Sandbox Code Playgroud)
这显然是一个iOS7错误.在我的应用程序中,我发现即使在使用此媒体查询打开屏幕键盘的情况下聚焦于输入字段时,我也可以可靠地区分纵向模式和横向模式:
@media only screen and (device-width: 768px) and (device-height: 1024px) and
(min-aspect-ratio: 4/3) {
/* landscape differences here */
}
Run Code Online (Sandbox Code Playgroud)
我无法使用方向:横向,因为如果键盘打开,即使在纵向模式下规则也会被激活.
我可能需要一个不同的iPhone规则,但我还没有那么远.
| 归档时间: |
|
| 查看次数: |
2583 次 |
| 最近记录: |