::-moz-color-swatch
非标准: 该特性是非标准的,请尽量不要在生产环境中使用它!
::-moz-color-swatch
CSS 伪元素是用于表示在 type="color"
的 <input>
中选择的颜色的 Mozilla 扩展。
备注:
除了 <input type="color">
以外,使用 ::-moz-color-swatch
不会匹配任何内容,也没有任何效果。
语法
css
::-moz-color-swatch {
/* ... */
}
示例
HTML
html
<input type="color" value="#de2020" />
CSS
css
input[type="color"]::-moz-color-swatch {
border-radius: 10px;
border-style: none;
}
结果
规范
不属于任何规范。
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
::-moz-color-swatch |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- Non-standard. Check cross-browser support before using.
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.
参见
-
其他浏览器也使用类似的伪元素:
::-webkit-color-swatch
,WebKit 和 Blink(Safari、Chrome 和 Opera)支持的伪元素