DEV Community

Ed is Taking Note
Ed is Taking Note

Posted on • Edited on

2 2

[CSS Trick] Mask Image

We can use css mask to change the svg icon color.

<h1 class="text">AIRCRAFT</h1>
Enter fullscreen mode Exit fullscreen mode
.text::before {
  content: "";
  display: inline-block;
  height: 25px;
  width: 25px;
  margin-right: 8px;

  background-color: #eb2f64;
  -webkit-mask-image: url(../img/SVG/aircraft.svg);
  -webkit-mask-size: cover;
  mask-image: url(../img/SVG/aircraft.svg);
  mask-size: cover;
}
Enter fullscreen mode Exit fullscreen mode

Result:
Image description

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay