非标准
该特性是非标准的,请尽量不要在生产环境中使用它!
在CSS 伪类是Mozilla的扩展匹配任何元素,而它在非活动窗口。:-moz-window-inactive
:-moz-window-inactive
也在内容HTML文档中工作。
注意:在添加此伪类之前,通过
active="true"
在顶级XUL chrome窗口上设置attribute()来实现为背景窗口提供不同样式。该属性不再使用。示例
此示例根据窗口是否处于活动状态来改变框背景的外观。
HTML
<div id=“mybox”>
<p>这是一个盒子!</p>
</div>
CSS
#mybox {
background: linear-gradient(to bottom, yellow, cyan);
width: 200px;
height: 200px;
}
#mybox:-moz-window-inactive {
background: cyan;
}
Link to section结果
您可以将其视为live sample here。
产品规格
不属于任何规范。这是专门针对Gecko的专有伪类。
浏览器兼容性
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help!
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 未实现 | 未实现 | 4.0 (2)[1] | 未实现 | 未实现 | 未实现 |
Feature | Android | Chrome for Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Basic support | 未实现 | 未实现 | 未实现 | 未实现 | 未实现 | 未实现 | 未实现 |
[1] Implemented in bug 508482.