Superscript and Subscript
You can vertically align your text within a web page.
Superscript Example
3×102
Place the following code before the text you would like to align:
<span style="vertical-align: 30%;">3x102</span> |
Edit the text in bold to suit your needs.
Place the following code after the text you would like to align:
Subscript Example
C6H12O6
Place the following code before the text you would like to align:
<span style="vertical-align: 30%;">C6H12O6</span> |
Edit the text in bold to suit your needs.
Place the following code after the text you would like to align:
The percentage specifies a percentage of the distance to the line height above or below the normal line height. It raises or lowers the baseline by a percentage of the line-height to the next line. For example, a value of 50% will raise the baseline to halfway between the normal baseline and the baseline of the line above. A value of -100% will lower the baseline to the same height as the baseline of the line below. 30% or -30% looks about right for things like scientific notation.
Code provided by:
John Nitkowski
More Web Design
Tips |