有一个与此相关的问题: Media Query for iPad (Landscape) applied to Samsung Galaxy Tab 2 (Landscape) as well
我的问题是让 Android Samsung Galaxy Tab 2 10.1(Chrome 浏览器 18)上的 Chrome 浏览器被检测为纵向模式的媒体查询是什么。
我目前正在使用:
@media all and (min-width: 479) and (max-width: 1199) and (max-device-width:1199px and (orientation: portrait)
但它不起作用。它可以在 Android 网络浏览器上运行,但一旦您将其切换到横向模式然后返回纵向模式,它将无法运行。它仅在您以纵向模式加载页面时有效。
最佳答案
这对我适用于 Samsung Galaxy Tab 10.1
@media only screen and (min-width: 800px) and (max-height: 1280px) and
(orientation : portrait){
/* Your code here */
}
@media only screen and (min-width: 1280px) and (max-height: 800px) and
(orientation : landscape){
/* Your code here */
}
关于android - 三星 Galaxy Tab 2 10.1(Chrome 浏览器)的 CSS 媒体查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14820793/