颜色索引 | @media.color-index (Media Queries)


  •   CSS 中文开发手册

    颜色索引 | @media.color-index (Media Queries) - CSS 中文开发手册

    @media.color-index

    该color-index CSS @media媒体功能可用于基于条目的输出设备的颜色查找表的数量应用样式。

    语法

    该color-index功能被指定为<integer>值表示输出设备的颜色查找表中的条目数量的值。(如果设备不使用这样的表,则此值为零)。这是一个范围特性,也就是说,也可以使用前缀min-color-index和max-color-index变量分别查询最小值和最大值。

    实例

    基本实例

    HTML

    <p>This is a test.</p>

    CSS

    p {
      color: black;
    }
    
    @media (color-index) {
      p {
        color: red;
      }
    }
    
    @media (min-color-index: 15000) {
      p {
        color: #1475ef;
      }
    }

    结果

    自定义样式表

    此HTML将为至少有256种颜色的设备应用特殊的样式表。

    <link rel="stylesheet" href="http://foo.bar.com/base.css" />
    <link rel="stylesheet" media="all and (min-color-index: 256)" href="http://foo.bar.com/color-stylesheet.css" />

    规范

    Specification

    Status

    Comment

    Media Queries Level 4The definition of 'color-index' in that specification.

    Working Draft

    The value can now be negative, in which case it computes to false.

    Media QueriesThe definition of 'color-index' in that specification.

    Recommendation

    Initial definition. The value must be nonnegative.

    浏览器兼容性

    Feature

    Chrome

    Firefox (Gecko)

    Internet Explorer

    Opera

    Safari

    Basic support

    (Yes)

    ?

    ?

    ?

    ?

    Feature

    Android

    Firefox Mobile (Gecko)

    IE Mobile

    Opera Mobile

    Safari Mobile

    Basic support

    ?

    ?

    ?

    ?

    ?

    
    
  •   CSS 中文开发手册
  • 转载请保留页面地址:https://www.breakyizhan.com/css/32467.html