Samsung Galaxy Tab 2 10.1的CSS媒体查询(Chrome浏览器) [英] CSS Media Query for Samsung Galaxy Tab 2 10.1 (Chrome Browser)

查看:69
本文介绍了Samsung Galaxy Tab 2 10.1的CSS媒体查询(Chrome浏览器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个与此相关的问题: iPad的媒体查询(横向)也适用于Samsung Galaxy Tab 2(横向)

There was a related question to this in: Media Query for iPad (Landscape) applied to Samsung Galaxy Tab 2 (Landscape) as well

我的问题是什么媒体查询可以使Android Samsung Galaxy Tab 2 10.1(Chrome浏览器18)上的Chrome浏览器被检测为纵向模式.

My question is what is the media query to get the Chrome browser on the Android Samsung Galaxy Tab 2 10.1 (Chrome Browser 18) to be detected as portrait mode.

我当前正在使用:

@media all and (min-width: 479) and (max-width: 1199) and (max-device-width:1199px and (orientation: portrait)

但是它不起作用.它可以在Android Web浏览器上运行,但是一旦将其翻转到横向模式然后又回到纵向模式,将无法使用.仅当以纵向模式加载页面时,该功能才起作用.

But it doesn't work. It will work on the Android web browser but will not work once you flip it to landscape mode and then back to portrait mode. It will only work when you load page in portrait mode.

推荐答案

这在Samsung Galaxy Tab 10.1上对我有效

This works for me on 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 */
}

这篇关于Samsung Galaxy Tab 2 10.1的CSS媒体查询(Chrome浏览器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆