CSS参考手册
媒体查询 | Media Queries
网格 | @media.grid
@media.grid
该grid
CSS @media
媒体功能可用于应用基于输出设备是否使用基于位图的基于网格或屏幕的风格。
语法
该grid
特征被指定为表示输出设备是否基于网格的<mq-boolean>
值(0
或1
)。
例子
HTML
<p class="unknown">I don't know if you're using a grid device. :-(</p>
<p class="bitmap">You are using a bitmap device.</p>
<p class="grid">You are using a grid device! Neato!</p>
CSS
:not(.unknown) {
color: lightgray;
}
@media (grid: 0) {
.unknown {
color: lightgray;
}
.bitmap {
color: red;
}
}
@media (grid: 1) {
.unknown {
color: lightgray;
}
.grid {
color: red;
}
}
结果
规范
Specification |
Status |
Comment |
---|---|---|
Media Queries Level 4The definition of 'grid' in that specification. |
Working Draft |
No change. |
Media QueriesThe definition of 'grid' in that specification. |
Recommendation |
Initial definition. |
浏览器兼容性
Feature |
Chrome |
Firefox (Gecko) |
Internet Explorer |
Opera |
Safari |
---|---|---|---|---|---|
Basic support |
(Yes) |
(Yes) |
? |
(Yes) |
(Yes) |
Feature |
Android |
Firefox Mobile (Gecko) |
IE Mobile |
Opera Mobile |
Safari Mobile |
---|---|---|---|---|---|
Basic support |
? |
? |
? |
? |
? |
媒体查询 | Media Queries相关
层叠样式表( Cascading Style Sheets )是一种用来表现 HTML 或 XML 等文件样式的计算机语言。CSS 不仅可以静态地修饰网页,还可以配合各种脚本语言动态地对网页各元素进行格式化。