仅将媒体查询添加到特定设备ipad pro

时间:2017-06-19 06:18:35

标签: html css css3 media-queries

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

3 个答案:

答案 0 :(得分:2)

here

粘贴的复制件
@media (min-height: 1024px) and (min-width: 1366px) {
    /* CSS stuff */
}

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

答案 1 :(得分:0)

@media only screen 
and (min-device-width : 1024px) 
and (max-device-width : 1366px) { /* STYLES GO HERE */}

参考link

答案 2 :(得分:0)

    @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
}