【问题标题】:How to create a media query that applies to all iPads in portrait?如何创建适用于所有纵向 iPad 的媒体查询?
【发布时间】:2013-06-16 22:22:32
【问题描述】:

问题在于旧 iPad 的分辨率为 768 x 1024 像素,而新 iPad 的分辨率为 1536 x 2048 像素。如何在一个媒体查询中解决机器人 iPad 的肖像问题?这可能吗?

<link rel="stylesheet" href="stylesheets/device.css" media="only screen and (((min-width:768px) and (max-width: 1024px)) or ((min-width:1536px) and (max-width: 2048px)))">

我找不到像这样嵌套媒体查询条件的示例。

【问题讨论】:

    标签: html css ipad media-queries


    【解决方案1】:
    @media only screen 
    and (min-device-width : 768px) 
    and (max-device-width : 1024px) 
    and (orientation : portrait) { /* STYLES GO HERE */ }
    

    看到这个link希望它对你有用

    【讨论】:

    • 虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接的答案可能会失效。
    • 感谢您的宝贵建议
    • 有人能解释一下使用 min-width: 和 min-device-width: 有什么区别吗?我假设 min-device-width 适用于非视网膜和视网膜 iPad?
    猜你喜欢
    • 2019-01-21
    • 2014-12-24
    • 2012-12-04
    • 2020-01-20
    • 2013-01-26
    • 2012-12-22
    • 2013-09-18
    • 2023-03-07
    • 2023-03-20
    相关资源
    最近更新 更多