dpcm

说明

每厘米包含点的数量(dots per centimeter)

  • 普通屏幕通常包含96dpi,一般将2倍于此的屏幕称之为高分屏,即大于等于192dpi的屏幕,比如Mac视网膜屏就达到了192dpi(即2dppx),打印时一般会需要更大的dpi;
  • 1dppx = 96dpi
  • 1dpi ≈ 0.39dpcm
  • 1dpcm ≈ 2.54dpi
  • 1in = 2.54cm = 25.4 mm = 101.6q = 72pt = 6pc = 96px

兼容性

IE Firefox Chrome Safari Opera iOS Safari Android Browser Android Chrome
6.0-8.0 2.0-3.4 4.0-28.0 3.1-8.1 15.0+ 3.2-8.1 2.1-4.4.4 18.0-29.0
9.0+ 3.5+ 29.0+ 29.0+

示例


<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<style>
@media screen and (min-resolution: 75.5dpcm) {
    .normal{display:none;}
}
@media screen and (min-resolution: 28.3dpcm) and (max-resolution: 75.4dpcm) {
    .retina{display:none;}
}
</style>
</head>
<body>
<p class="retina">视网膜屏</p>
<p class="normal">普通屏</p>
</body>
</html>