?
This document uses PHP Chinese website manual Release
resolution:<resolution>
<resolution>:用整數(shù)值來定義寬度。不允許負(fù)值
本特性接受min和max前綴,因此可以派生出min-resolution和max-resolution兩個(gè)媒體特性。
簡單列舉幾個(gè)應(yīng)用示例:
@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參考手冊(cè)_web前端開發(fā)參考手冊(cè)系列</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">當(dāng)你的輸出設(shè)備分辨率大于或等于96dpi時(shí),本行文字顯示為紅色</div> <script> </script> </body> </html>
點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例