Tuesday, September 14, 2010

Teletype, subscript, and superscript

This leaves three useful physical styles. The first, tt, renders text in a monospace font (à la
teletype text). The others, sub and sup, render text as subscript and superscript text,
respectively. These are useful for scientific documents, although there is a drawback: characters
are displayed at the same size, defined by the browser. You can get around this by
using a CSS tag selector and defining a new font size for each element. The following code
shows how to do this, and the accompanying screenshot shows a default sup element (at
the top of the image) and a CSS-styled sup element (at the bottom) in use.
sup {
font-size: 70%;
}

No comments:

Post a Comment