<p><em>meta key here</em>:: meta value here</p>
i, em {
color: red;
font-size: 80%;
font-style: italic;
}
I want to format the next two colon characters same as the <em> element.
I can format with CSS, but I can’t add more HTML tags in the source.
2
Answers
The only way to do what you are asking for without javascript is to define
::
as pseudo element’s contentCSS has no way of selecting certain number of chars of certain element, you can only select first letter
There are more ways to go around this obviously, but you’d need to add more elements in html for this
So this is actually the only option you have
CSS pseudo elements can solve this problem, here is the details of Before pseudo element.