Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS :before superscript "6"? [duplicate]

Is there a way to add a superscript "6" into the "content" CSS property for a pseudo element? I've been all over the web, trying different Unicode strings and glyph codes to try to get this to work, but haven't found a solution.

Thanks!

EDIT: Sorry for not clarifying... I'm needing to put the superscript "6" amongst other text in the same "content" property. Looks like I'll need to just define a different encoding for my CSS and drop it in as a literal character.

like image 972
wdews Avatar asked Mar 19 '26 02:03

wdews


1 Answers

There is another solution, as in this fiddle

element:before{
    content:'6'; 
    vertical-align: super; /* make superscript */
    font-size:8px;
}
like image 53
SW4 Avatar answered Mar 21 '26 23:03

SW4



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!