I want to use css to change the style of some text but not the ::before and ::after content that I also want to add. But i cant find a way of doing it. I'm using React if that makes a difference.
The text in my .js file is
<span className="startMonth">£12</span>
My css is:
startMonth {
text-decoration: line-through ;
color:red;
}
.startMonth::before {
text-decoration: none !important ;
content: "Special Offer ";
color: red;
}
.startMonth::after {
text-decoration: none !important ;
content: " FREE";
}
ie. I want only the £12 to have a line through, but the result is a line through all the text. Any way I can do it without editing the .js.
Thanks.