使用CSS将透明像素转换为指定颜色,并使不透明像素透明

使用蒙版效果将透明像素变为指定的颜色,并使不透明像素透明。 

在此过滤器中使用以下参数

序号
参数及说明
1
Color
透明区域将变为的颜色。

示例

您可以尝试运行以下代码来实现遮罩效果

<html>

   <head>

   </head>

   <body>

      <img src = "/css/images/logo.png"alt = "CSS Logo"style = "FILTER: Chroma(Color = #000000) Mask(Color=#00FF00)">

      <p>Text Example:</p>

      <div style = "width: 357;

         height: 50;

         font-size: 30pt;

         font-family: Arial Black;

         color: red;

         Filter: Mask(Color=#00FF00)">CSS Tutorials</div>

   </body>

</html>

以上是 使用CSS将透明像素转换为指定颜色,并使不透明像素透明 的全部内容, 来源链接: utcz.com/z/321395.html

回到顶部