这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
草案
此页面不完整。
prefers-reduced-transparency
CSS
media feature
is used to detect if the user has requested that the system minimize the amount of transparency used across elements.
no-preference
Indicates that the user has made no preference known to the system. This keyword value evaluates as false in the boolean context.
reduce
Indicates that user has notified the system that they prefer an interface that minimizes the amount of transparent or translucent layer effects.
Currently no user agent implements this feature, although various operating systems do support such preferences and if this media query is ever implemented user agents will likely rely on the settings provided by the operating systems.
注意: No browser currently implements this feature so the following example will not work.
This example has an annoying transparency effect by default.
<div class="transparency">transparent box</div>
.transparency {
opacity: 0.5;
}
@media (prefers-reduced-transparency: reduce) {
.transparency {
opacity: 1;
}
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
Media Queries Level 5
The definition of 'prefers-reduced-transparency' in that specification. |
编者草案 | 初始定义。 |
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
更新 GitHub 上的兼容性数据| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
prefers-reduced-transparency
media feature
Experimental
|
Chrome 不支持 No | Edge 不支持 No | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
不支持
实验。期望将来行为有所改变。