1

How do you use a font-family's symbols, glyphs, ornaments and other features inside? For example how do you use a font's superscript?

1

You are after two different things

You insert special characters e.g copyright, accented letters, by using HTML entities e.g. © or © for ©. Here is a list https://www.freeformatter.com/html-entities.html

To achieve superscript, it has nothing to do with entities. In this case it is the size and placement of text.

Your HTML would look like this

<p>H<span class="atoms">2</span>SO<span class="atoms">4</span> is the chemical formula for sulphuric acid.
But how is this gold Au<span class="charge">2+</span>?</p>

the CSS would be

p { line-height: 1.5 }

.charge {
    position: relative;
    bottom: 0.5em;
    color: red;
    font-size: 0.8em;
}

.atoms {
    position: relative;
    top: 0.3em;
    color: blue;
    font-size: 0.8em;
}

This example comes from http://htmldog.com/techniques/superscript/ see it in action here http://htmldog.com/examples/superscript/

I have no association with either of the pages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.