【问题标题】:Add media query only to specific device ipad pro仅将媒体查询添加到特定设备 ipad pro
【发布时间】:2017-11-21 05:58:31
【问题描述】:

我想将媒体查询添加到尺寸为 1366*1024 高度宽度和高度的特定设备 ipad pro。如何将媒体查询添加到仅针对该宽度和高度的尺寸。不小于 1366 或大于 1366! !!

【问题讨论】:

  • 请添加您尝试过的代码。

标签: html css media-queries


【解决方案1】:

从here复制粘贴

@media (min-height: 1024px) and (min-width: 1366px) {
    /* CSS stuff */
}

不要忘记标题上的<meta name="viewport" content="width=device-width, initial-scale=1.0"> 元标记。

【讨论】:

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

参考link

【讨论】:

    【解决方案3】:
        @media only screen 
          and (min-device-width: 1024px) 
          and (max-device-width: 1366px) 
          and (-webkit-min-device-pixel-ratio: 1.5) {
      //code
        }
    

    您还可以指定要设置为纵向还是横向:

        /* Portrait */
        @media only screen 
          and (min-device-width: 1024px) 
          and (max-device-width: 1366px) 
          and (orientation: portrait) 
          and (-webkit-min-device-pixel-ratio: 1.5) {
      //code
        }
    
    /* Landscape */
    @media only screen 
      and (min-device-width: 1024px) 
      and (max-device-width: 1366px) 
      and (orientation: landscape) 
      and (-webkit-min-device-pixel-ratio: 1.5) {
    //code
    }
    

    【讨论】:

      猜你喜欢
      • 2021-08-25
      • 1970-01-01
      • 2022-07-07
      • 2014-12-25
      • 1970-01-01
      • 2014-02-19
      • 2013-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多