css - iPad Pro 12.9 媒体查询不起作用

标签 css media-queries

我正在尝试为 iPad Pro 12.9 英寸版本实现以下媒体查询,但当我检查实际的 iPad 设备时它不起作用。

@media only screen   and (min-device-width: 1024px)   and (max-device-width: 1366px)   and (orientation: landscape)   and (-webkit-min-device-pixel-ratio: 2)
{
//CSS
}

上面的媒体查询在 Chrome 上工作,但是当我检查实际设备甚至 xCode 上的模拟器时,它不起作用。我也尝试过 (-webkit-min-device-pixel-ratio: 2 )。结果相同

最佳答案

这里是 iPad Pro 12.9 英寸的工作代码。 由于信息严重缺乏,我费了很大劲,但我现在找到了工作参数。

// For both Portrait and Landscape
@media only screen
    and (min-device-width: 768px)
    and (max-device-width: 2732px)
    and (-webkit-min-device-pixel-ratio: 2){
       // CSS HERE
}

// For landscape
@media only screen
    and (min-device-width: 768px)
    and (max-device-width: 2732px)
    and (orientation:landscape)
    and (-webkit-min-device-pixel-ratio: 2){
       // CSS HERE
}

// For Portrait
@media only screen
    and (min-device-width: 768px)
    and (max-device-width: 2732px)
    and (orientation:portrait)
    and (-webkit-min-device-pixel-ratio: 2){
       // CSS HERE
}

关于css - iPad Pro 12.9 媒体查询不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46610621/

相关文章:

asp.net - CSS 更改未反射(reflect)在网站上

html - 像 twitter bootstrap 一样的单杠图标

html - 使用 html 和 css 对齐 div 时出现问题

twitter-bootstrap - LESS:作为mixin访问媒体查询中的类

html - 我怎样才能让这个容器和 table 响应手机和 ipad 的大小?

php - 具体如何制作 "tree view"

javascript - 如何使用 bootstrap 或 js 在数据列表中设置滚动条?

css - 额外的括号导致简单的媒体查询失败

javascript - 如何使用媒体查询显示/隐藏元素?

css - 如何在媒体查询中使用 > 或 <(大于和小于)符号