CSS参考手册
媒体查询 | Media Queries
单色帧缓冲区中每像素的位数 | @media.monochrome
@media.monochrome
monochrome
CSS @media
媒体功能可用于基于在所述输出装置的单色帧缓冲器每像素的比特数来应用样式。
语法
该monochrome
特征被指定为<integer>
表示单色帧缓冲器中每个像素的位数。如果设备不是单色设备,则该值为零。这是一个范围功能,也就是说,您也可以使用前缀min-monochrome
和max-monochrome
变量分别查询最小值和最大值。
例子
HTML
<p>How many bits does your device support for monochrome pixels?</p>
CSS
/* Any monochrome device */
@media (monochrome) {
p {
color: #333;
}
}
/* Any non-monochrome device */
@media (monochrome: 0) {
p {
color: #ee3636;
}
}
结果
规范
Specification |
Status |
Comment |
---|---|---|
Media Queries Level 4The definition of 'monochrome' in that specification. |
Working Draft |
The value can now be negative, in which case it computes to false. |
Media QueriesThe definition of 'monochrome' in that specification. |
Recommendation |
Initial definition. The value must be nonnegative. |
浏览器兼容性
Feature |
Chrome |
Firefox (Gecko) |
Internet Explorer |
Opera |
Safari |
---|---|---|---|---|---|
Basic support |
(Yes) |
(Yes) |
? |
(Yes) |
? |
Feature |
Android |
Firefox Mobile (Gecko) |
IE Mobile |
Opera Mobile |
Safari Mobile |
---|---|---|---|---|---|
Basic support |
? |
? |
? |
? |
? |
媒体查询 | Media Queries相关
层叠样式表( Cascading Style Sheets )是一种用来表现 HTML 或 XML 等文件样式的计算机语言。CSS 不仅可以静态地修饰网页,还可以配合各种脚本语言动态地对网页各元素进行格式化。