Teaching and Learning with Technology

Computing With Accents and Foreign Scripts

Skip Menu

Superscript and Subscript

There are several approaches to displaying superscript and subscript text on the Web, and each have their uses depending on your needs.

This Page

  1. HTML and CSS
  2. Using Unicode Values
  3. Unicode Chart - New Page
  4. Microsoft Word- New Page

HTML and CSS

For most purposes, you can use the <sup></sup> tag to create super script text and <sub></sub> to create sub-script text. See examples below:

Code: x<sup>x+1</sup>
Result: xx+1

Code: x<sub>i+1</sub>
Result: xi+1

Note: Although some Web standards professionals recommend avoiding these tags, they are an official XHTML standard.

CSS Styles and the SUP/SUB Tags

You change the CSS attributes of the <sup> and <sub> tags to improve line spacing, formatting and placement of characters. See references below:

All CSS Instead?

Some Web standards professionals recommend using CSS formatting instead the <sup> and <sub> tags on the theory that these tags are "presentational." The disadvantage to this approach is that if a user disables your stylesheet, the superscripts and subscripts will disappear.

However, if you are more comfortable with using the CSS attributes, you can refer to these pages.

Top of Page

 

Using Unicode Values

Many common superscript and subscript characters have their own Unicode entries and entity codes. If your Web page is generated from a database or meant to be a searchable archive, the use of Unicode values may be preferable.

Top of Page

Microsoft Word

See updated instructions on the Microsoft Office page.

 

Top of Page

Tuesday, 04-Jun-2013 12:41:35 EDT