使用 CSS 设置反色效果


反色效果用于将对象的 color 中的值映射到色谱中的相反值,也就是说,创建负片图像。

该滤镜中使用以下参数:

序列号参数和描述
1
反色
将对象的 color 映射到 color 中的相反值。

示例

你可以尝试运行以下代码来实现反色效果:

实时演示

<html>
   <head>
   </head>
   <body>
      <img src = "/images/css.gif" alt = "CSS Logo" style = "Filter: invert" />
      <p>Text Example:</p>
      <div style = "width: 357; height: 50; font-size: 30pt; font-family: Arial Black;
         color: red; Filter: invert">
         CSS Tutorials
      </div>
   </body>
</html>

更新时间: 27-Jun-2020

浏览次数:237

开启您的职业生涯

完成课程认证

开始学习
广告