?
This document uses PHP Chinese website manual Release
resolution:<resolution>
<resolution>:用整數值來定義寬度。不允許負值
本特性接受min和max前綴,因此可以派生出min-resolution和max-resolution兩個媒體特性。
簡單列舉幾個應用示例:
@media screen and (resolution){ … } @import url(example.css) screen and (min-resolution:96dpi); <link media="screen and (resolution:96dpi)" rel="stylesheet" href="example.css" />
支持版本\類型 | IE | Firefox | Safari | Chrome | Opera |
---|---|---|---|---|---|
較早版本 | 6-8 | 4 | 5.1.7 | 13-23 | 11.5 |
較近版本 | 9 |
<!DOCTYPE html> <html lang="zh-cmn-Hans"> <head> <meta charset="utf-8" /> <title>resolution of media features_CSS參考手冊_web前端開發(fā)參考手冊系列</title> <meta name="author" content="Joy Du(飄零霧雨), dooyoe@gmail.com, www.doyoe.com" /> <style> @media screen and (min-resolution:96dpi){ body{color:#f00;} } </style> </head> <body> <div class="test">當你的輸出設備分辨率大于或等于96dpi時,本行文字顯示為紅色</div> <script> </script> </body> </html>
點擊 "運行實例" 按鈕查看在線實例