filter: mask(***);

Browser
  • IE
Type
  • Extension

The mask filter add the mask effect to the element.

Changes the transparent area to the specified color, and changes the non-transparent area to transparent.


#example {
filter: mask(color=#0000ff);
}

Attribute Value Explanation
color color code or name the color of the transparent area

Example

The original

<img src="image/friend2.gif" alt="IMG" width="170" height="140">

Output
IMG

<div style="font: bold 170% sans-serif; width: 100%;">
Example text
</div>

Output
Example text
The mask effect

<img src="image/friend2.gif" alt="IMG" width="170" height="140" style="filter: mask(color=#ffd37d);">

Output
IMG

<div style="font: bold 170% sans-serif; width: 100%; filter: mask(color=green);">
Example text
</div>

Output
Example text