JSFiddle - React, Tailwind, and code Playground
by kaidjohnson
HTML
<h3>For the following characters, the glyph is superscripted by default, so <strong>don't</strong> wrap them with a <code>sup</code> tag.</h3>
<p>This is a <a href="#">linked' apostrophe</a> for testing.</p>
<p>This is a <a href="#">linked" quotation mark</a> for testing.</p>
<p>This is a <a href="#">linked‘ left single quotation mark</a> for testing.</p>
<p>This is a <a href="#">linked’ right single quotation mark</a> for testing.</p>
<p>This is a <a href="#">linked“ left double quotation mark</a> for testing.</p>
<p>This is a <a href="#">linked” right double quotation mark</a> for testing.</p>
<p>This is a <a href="#">linked′ prime</a> for testing.</p>
<p>This is a <a href="#">linked″ double prime</a> for testing.</p>
<p>This is a <a href="#">linked´ acute accent</a> for testing.</p>
<p>This is a <a href="#">linked˜ small tilde</a> for testing.</p>
<p>This is a <a href="#">linkedˆ modifier letter circumflex accent</a> for testing.</p>
<p>This is a <a href="#">linked‾ overline</a> for testing.</p>
<p>This is a <a href="#">linked¹ superscript one</a> for testing.</p>
<p>This is a <a href="#">linked² superscript two</a> for testing.</p>
<p>This is a <a href="#">linked³ superscript three</a> for testing.</p>
<p>This is a <a href="#">linkedª feminine ordinal indicator</a> for testing.</p>
<p>This is a <a href="#">linkedº masculine ordinal indicator</a> for testing.</p>
<p>This is a <a href="#">linked¯ macron</a> for testing.</p>
<p>This is a <a href="#">linked¨ diaeresis</a> for testing.</p>
<p>This is a <a href="#">linked° degree symbol</a> for testing.</p>
<p>This is a <a href="#">linked™ trademark symbol</a> for testing.</p>
<h3>For the following characters, the glyph is not superscripted by default. If you need them to be superscripted, you'll need to wrap them...
CSS
sub, sup {
/* Specified in % so that the sup/sup is the
right size relative to the surrounding text */
font-size: 75%;
/* Zero out the line-height so that it doesn't
interfere with the positioning that follows */
line-height: 0;
/* Note that if you're using Eric Meyer's reset.css, this
is already set and you can remove this rule */
vertical-align: baseline;
/* Prevent sup and sub from rendering text-decoration */
display: inline-block;
}
sup {
/* Move the superscripted text up */
transform: translateY(-0.5em);
}
sub {
/* Move the subscripted text down, but only
half as far down as the superscript moved up */
transform: translateY(-0.25em);
}