0

Is there a way to Add CSS pseudo element to an SVG? I wish to add text to the SVG element with the content: (); property.

Codepen is here

.grade1 {
  stroke: #07FF00;
  stroke-width: 3;
  fill: #BBFFA6;
}

.grade1::after {
  content: "Grade 1";
  width: 40px;
  height: 40px;
}
<svg xmlns="http://www.w3.org/2000/svg" width="43.4" height="43.4">
       <circle class="grade1" cx="21.7" cy="21.7" r="19.2"></circle>
    </svg>
Turnip
  • 35,836
  • 15
  • 89
  • 111
MrThunder
  • 725
  • 12
  • 21

0 Answers0