非视网膜屏幕有任何媒体查询吗?

7
根据CSS-Tricks上的一篇文章,针对视网膜屏幕的未来证明的媒体查询可以编写为:
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (   min--moz-device-pixel-ratio: 2),
only screen and (     -o-min-device-pixel-ratio: 2/1),
only screen and (        min-device-pixel-ratio: 2),
only screen and (                min-resolution: 192dpi),
only screen and (                min-resolution: 2dppx) { 

  /* Retina-specific stuff here */

}

如果我想为非视网膜显示器编写CSS代码怎么办?
我知道你可以先为非视网膜显示器编写一些CSS代码,然后使用上面的媒体查询来覆盖视网膜显示器。但是是否有专门针对非视网膜显示器的媒体查询呢?
1个回答

9

这篇文章同样来自CSS-Tricks,它指出你可以使用not来反转逻辑。因此理论上:

@media
not screen and (-webkit-min-device-pixel-ratio: 2),
not screen and (   min--moz-device-pixel-ratio: 2),
not screen and (     -o-min-device-pixel-ratio: 2/1),
not screen and (        min-device-pixel-ratio: 2),
not screen and (                min-resolution: 192dpi),
not screen and (                min-resolution: 2dppx) { 

  /* non-Retina-specific stuff here */

}

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接