HTML: Subscript and Superscript Tags
Subscript and Superscript
If you are thinking what is subscript and Superscript, just reread your chemistry and maths books for reference! Confused huh?
See the image below
You may got it now. (guess I reminded you of your school) Yes, it is called Superscripting and subscripting.
For this we have two tags Namely
<sup> is used for Super Script
<sub> is used for Sub Script
Remember these two are paired tags Means they have closing tags!
Let's see the sample code below:
<html>
<head>
<title> Subscript And Superscript </title>
</head>
<body>
<h1> Subscript and Superscript <h1
<p><b> Algebric Identity :</b>(a - b)<sup> 2 </sup> = a <sup> 2 </sup> - 2ab + b <sup> 2 </sup></p>
<p><b> Carbon Di-Oxide: </b> CO <sub> 2 </sub></p>
</body>
</html>
You can see that I covered the square number (2) inside Superscript tag and To write CO2 where 2 is subscripted, I wrapped it with superscript tag. The output of the following code will be this
As you can see the content I covered with Superscript tag appears Superscripted. And The content that I covered in subscript tag, appears sub scripted.
Remember these tags are not used much, These tags are one of the rarely used tags in HTML. Because there is less need for them. Even though they are rare, It is not a bad idea to learn about them. It is good know that these tags actually exists. Many people don't remember theses tags at all. It is because of their usages. Well this is a mini post. ( It should be said as micro )
On our next post we will see some more tags.
Exercise Time!
This exercise is not compulsory or mandatory. Just do it, if you want to test yourself!
Make an HTML Code, Which gives the following output:
This is a small post which explains these two rare tags.
Okay guys, see you all in next post, till then take care!
Feel free to ask your queries in comment section below.
Stay Tuned♡!
Comments
Post a Comment