使用 CSS 将对象的颜色转换为 256 级灰度
cssweb developmentfront end technology更新于 2025/9/8 23:40:17
使用灰度效果将对象的颜色转换为 256 级灰度。此滤镜使用以下参数:
| 参数 | 描述 |
|---|---|
| Gray | 将对象的颜色转换为 256 级灰度。 |
示例
您可以尝试运行以下代码来设置灰度效果:
<html> <head> </head> <body> <img src="/css/images/logo.png" alt="CSS Logo" style="Filter: Gray"> <p>Text Example:</p> <div style="width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: red; Filter: Gray">CSS Tutorials</div> </body> </html>
相关文章
有用资源
css 参考教程 - 该教程包含有关 css 的更多信息:https://www.cainiaomax.com/css/

