00 Votes

HTML: Superscript or Subscript a Text

Question by Guest | 2017-12-17 at 21:30

I want to show some mathematical and chemical formulas on my website. These formulas often have indices or other superscripted or subscripted numbers or characters.

How can you raise or lower a text using HTML or CSS? I can not just write H20 for water.

ReplyPositiveNegative
0Best Answer0 Votes

You can use the HTML tags sub and sup for this purpose.

With sub (subscript text) you can set a text lower, with sup (superscript text) you can set a text higher.

Here is an example:

H<sub>2</sub>0

And here is how it looks like: H20

a<sup>2</sup> + b<sup>2</sup> = c<sup>2</sup> 

And here is how it looks like: a2 + b2 = c2

If you want to work with CSS, you should have a look at this page.
2017-12-17 at 21:40

ReplyPositive Negative
Reply

Related Topics

PHP: Sending an E-Mail

Tutorial | 0 Comments

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own article on askingbox.com. That’s how it’s done.