【发布时间】:2014-12-24 17:15:05
【问题描述】:
我有以下媒体查询...景观媒体查询始终优先。我试着改变这些想法的顺序,如果肖像是第一个,它会优先,但这不起作用。事实上,即使我完全删除了横向媒体查询并只留下纵向它也不起作用,所以看起来纵向媒体查询以某种方式被破坏了:S
这是我的两个查询:
/* iPad Retina, landscape */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : landscape)
and (-webkit-min-device-pixel-ratio: 2) {
#container {
width: 995px !important;
}
#currentroom_convo {
-webkit-overflow-scrolling: touch;
overflow-y: auto !important;
overflow-x: hidden !important;
}
.slimScrollBar .ui-draggable {
opacity: 0 !important;
}
}
/* iPad Retina, portrait*/
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : portrait)
and (-webkit-min-device-pixel-ratio: 2) {
#container {
width: 300px !important;
}
#currentroom_convo {
-webkit-overflow-scrolling: touch;
overflow-y: auto !important;
overflow-x: hidden !important;
}
.slimScrollBar .ui-draggable {
opacity: 0 !important;
}
div .topbar {
max-width: 300px !important;
}
}
我的标题中有这个元标记:
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimal-ui, user-scalable=no">
请注意,我正在使用 !important,因为我需要覆盖来自第三方插件的其他一些 CSS。在横向查询中删除 !important 不会导致 #container 元素发生任何变化(甚至仍然不会选择纵向查询)。
我试过在这里搜索,但似乎没有一个答案对我有用。谢谢:)
【问题讨论】:
-
尝试删除iPad竖屏CSS下
div .topbar中的空格,使其变为div.topbar。 -
我完全删除了 div .topbar 样式,但它仍然不起作用:(
-
我还从两个查询中删除了“and (-webkit-min-device-pixel-ratio: 2)”,认为这并没有太大的区别......它没有... :(
标签: css ipad media-queries