A+ A-

Html code for Monospaced font, Superscript Text and Subscript Text

 Monospaced Font - Html Tutorial :


The content material of a <tt>...</tt> element is composed in monospaced font. Almost all of the fonts are identified as variable-width fonts simply because various letters are of various widths (for instance, the letter 'm' is broader when compared with the letter 'i'). With a monospaced font, on the other hand, each and every letter provides the similar breadth.

Example :



<!DOCTYPE html>
<html>
<head>
<title>Monospaced Font Example</title>
</head>
<body>
<p>The following word uses a <tt>monospaced</tt> typeface.</p>
</body>
</html>


This will generate the following outcome :

The following word uses a monospaced typeface.


 Superscript Text - Html Tutorial :


The written content of a <sup>...</sup> element is composed in superscript; the font size utilized is the similar size as the characters surrounding it however is exhibited 50 percent a character's height over the other characters.

Example:



<!DOCTYPE html>
<html>
<head>
<title>Superscript Text Example</title>
</head>
<body>
<p>The following word uses a <sup>superscript</sup> typeface.</p>
</body>
</html>


This will generate the following outcome :

The following word uses a superscript typeface.

Subscript Text  -Html Tutorial :

The written content of a <sub>...</sub> element is composed in subscript; the font size utilized is the similar as the characters surrounding it, however is exhibited half a character's height beneath the other characters.

Example :



<!DOCTYPE html>
<html>
<head>
<title>Subscript Text Example</title>
</head>
<body>
<p>The following word uses a <sub>subscript</sub> typeface.</p>
</body>
</html>


This will generate the following outcome :


The following word uses a subscript typeface.