©
Ce document utilise Manuel du site Web PHP chinois Libérer
普通屏幕通常包含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
示例代码:
@media screen and (min-resolution: 28dpcm) { ... } @media print and (min-resolution: 118dpcm) { ... }
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> <meta charset="utf-8" /> <title>dpcm_CSS参考手册_web前端开发参考手册系列</title> <meta name="author" content="Joy Du(飘零雾雨), dooyoe@gmail.com, www.doyoe.com" /> <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>
点击 "运行实例" 按钮查看在线实例