?
This document uses PHP Chinese website manual Release
color:<integer>
<integer>:
用用整數(shù)值來定義彩色原件數(shù)。不允許負值
與色彩color不同,媒體特性color的取值只能是<integer>,用來表示色彩數(shù)。
本特性接受min和max前綴,因此可以派生出min-color和max-color兩個媒體特性。
簡單列舉幾個應(yīng)用示例:
@media screen and (color){ … } @import url(example.css) screen and (color:0); <link media="screen and (min-color:1)" rel="stylesheet" href="example.css" />
Values | IE | Firefox | Chrome | Safari | Opera | iOS Safari | Android Browser | Android Chrome |
---|---|---|---|---|---|---|---|---|
Basic Support | 6.0-8.0 | 2.0-3.0 | 4.0-25.0#1 | 6.0#1 | 15.0+ | 6.0-6.1#1 | 2.1-4.3#1 | 18.0-24.0#1 |
9.0-11.0#1 | 3.5+ | 26.0+ | 6.1+ | 7.0+ | 4.4+ | 25.0+ |
不支持嵌套媒體查詢。
<!DOCTYPE html> <html lang="zh-cmn-Hans"> <head> <meta charset="utf-8" /> <title>media features color_CSS參考手冊_web前端開發(fā)參考手冊系列</title> <meta name="author" content="Joy Du(飄零霧雨), dooyoe@gmail.com, www.doyoe.com" /> <style> @media screen and (color){ body{color:#f00;} } </style> </head> <body> <div class="test">當你的輸出設(shè)備是彩色的,本行文字顯示為紅色</div> <script> </script> </body> </html>
點擊 "運行實例" 按鈕查看在線實例