Explore 100's Of Free Video Tutorials

Keep Learning, Keep Coding & Keep Sharing

Subscript & superscript text

Notes:

HTML sub tag and HTML sup tag :

In mathematical, chemistry, physics formulas, and even annotations, we find some content sup scripted or super scripted. That is some content baseline will be shifted up or down. To display such text,we take help of sub and sup tags.
sub stands for subscript. sup stands for superscript.
sub tag: is a paired tag used to display sub scripted content.
sup tag: is a paired tag used to display super scripted content.

Example code:

<html>
<head>
<title>HTML sup and sup tags</title>
</head>
<body>
H<sub>2</sub>O <br/>
(a+b)<sup>2</sup> = a<sup>2</sup>+b<sup>2</sup>+2ab <br/>
</body>
</html>

Interview Questions:

1. Which HTML tag is used to display power of 2 in a mathematical expression (A+B)2=a2+b2+2ab?
a. sub
b. sup
c. super
d. power
Answer: b