.class {
&:after {
content: "m3/s";
}
}
I want to add a unit declaration via :after tag. Is it possible to make the 3 superscript?
This obviously doesn't work:
.class {
&:after {
content: "m<sup>3</sup>/s";
}
}
You can't style generated content partially (with the exception of combining :first-letter and :before), so no. You could use U+00B3 SUPERSCRIPT THREE instead:
.class {
&:after {
content: "m\00B3/s"; /* Or content: "m³/s"; */
}
}
... but I would recommend putting this as actual content and either using U+00B3, ³ or the <sup> element if it is semantically important.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With