我在 HEAD 标签中声明了以下内容:
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=768px, minimum-scale=1.0, maximum-scale=1.0" />
<link rel="stylesheet" media="all and (orientation:landscape}" href="css/landscape.css">
<link rel="stylesheet" media="all and (orientation:portrait}" href="css/portrait.css">
查看适用于 iPad 的 firebug lite,我看到正在应用 portrait.css 和 landscape.css 的样式。样式相互冲突并弄乱了我的页面。当我强制加载 portrait.css(通过删除横向线)时,纵向模式工作正常。当我强制加载横向(通过删除纵向线)时,横向工作正常。我希望 portrait.css 仅适用于纵向,而 landscape.css 仅适用于横向。
最佳答案
在你的媒体属性中,你有 来关闭条件,而不是
)
关于html - landscape.css 和 portrait.css 都被应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14198800/