?
This document uses PHP Chinese website manual Release
color-index:<integer>
<integer>:
用用整數(shù)值來(lái)定義彩色查詢表中的條目數(shù)。不允許負(fù)值
本特性接受min和max前綴,因此可以派生出min-color-index和max-color-index兩個(gè)媒體特性。
簡(jiǎn)單列舉幾個(gè)應(yīng)用示例:
@media screen and (color-index){ … }
@import url(example.css) screen and (min-color-index:1);
<link media="screen and (color-index:0)" 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>color-index of media features_CSS參考手冊(cè)_web前端開(kāi)發(fā)參考手冊(cè)系列</title> <meta name="author" content="Joy Du(飄零霧雨), dooyoe@gmail.com" /> <meta name="copyright" content="www.doyoe.com" /> <style> @media screen and (min-color-index:0){ body{color:#f00;} } </style> </head> <body> <div class="test">當(dāng)你的輸出設(shè)備使用了彩色查詢表時(shí),本行文字顯示為紅色</div> <script> </script> </body> </html>
點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例