Profil

A rejoint le : 22 août 2022

À propos
0 J'aime reçus
0 Commentaires reçus
0 Meilleur commentaire

change svg color in pseudo element

In this article, we'll show you how to change the color of an SVG path in CSS. This can be done by applying a pseudo-class that targets all SVG paths in your document. In this code example, we'll use a pseudo-element to change SVG's fill color. We can even use multiple pseudo-elements to switch between different colors. This is useful if you have more than one fill color in your SVG file.


Change svg color in pseudo element

By Rafvs on May 07, 2021 p:after {width: 48px;height: 48px;display: inline-block;content: '';-webkit-mask: url(https://gist.githubusercontent.com/mmathys/fbbfbc171233a30e478ad5b87ec4f5d8/raw/cd9219e336b8f3b85579015bdce9665def091bb8/heart.svg) no-repeat 50% 50%;mask: url(https://gist.githubusercontent.com/mmathys/fbbfbc171233a30e478ad5b87ec4f5d8/raw/cd9219e336b8f3b85579015bdce9665def091bb8/heart.svg) no-repeat 50% 50%;-webkit-mask-size: cover;mask-size: cover;}.red:after {background-color: red;}.green:after {background-color: green;}.blue:after {background-color: blue;}

Change Svg Color in Pseudo Element

Plus d'actions