这些颜色索引 CSS 媒体查询意味着什么?
下面的值是什么意思?
screen and (color-index: 256) //value 1
screen, (color-index: 256) //value 2
(color-index: 256) //value 3
What does the following values mean below?
screen and (color-index: 256) //value 1
screen, (color-index: 256) //value 2
(color-index: 256) //value 3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
值 3 是最简单的一个:
(color-index: 256)
匹配具有 256 种颜色的任何设备。值 1 将其与更常见的屏幕介质相结合,因此您只匹配具有 256 色的屏幕(与音频阅读器相反,在音频阅读器中,无论如何寻找“256 色”都是无意义的) )。
而Value 2有一个逗号,这从CSS的其他方面是可以识别的。我们可以写
p, h1 { color: Purple; }
表示如果一个元素是p
或h1
则适用该规则。这里是一个屏幕
或有 256 种颜色的设备。您可能会发现 https://developer.mozilla.org/En/CSS/Media_queries 具有指导意义。
Value 3 is the simplest one:
(color-index: 256)
matches any device with 256 colors.Value 1 combines that with the more common
screen
medium, so you're only matching screens with 256 colors (as opposed to, say, audio readers where "256 colors" is a nonsensical thing to look for anyway).And Value 2 has a comma, which is recognizable from other aspects of CSS. We might write
p, h1 { color: purple; }
indicating that if an element is either ap
OR anh1
the rule applies. Here it's a device that's ascreen
or has 256 colors.You may find https://developer.mozilla.org/En/CSS/Media_queries instructive.