Mobile app version of vmapp.org
Login or Join

Login to follow query

More posts by @Looi9037786

1 Comments

Sorted by latest first Latest Oldest Best

 

@Smith883

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 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 htmldog.com/techniques/superscript/ see it in action here htmldog.com/examples/superscript/
I have no association with either of the pages.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme