Difference between superscript and subscript.

Q6. What is the difference between superscript and subscript?

Ans.  Superscript: You can use the <SUB> tag to create a subscript in a Web page. This tag puts the character slightly below the line of regular text. The text specified between the start tag <SUB> and the end tag </SUB>tag is displayed in a smaller size and will be subscripted. The subscript tag is useful when you have to refer to a chemical formula in a Web page. The code given will display the use of the <SUB> tag:

<HTML>

<HEAD>

<TITLE> WELCOME TO HTML</TITLE>

</HEAD>

<BODY>

This is an example of creating subscript.

<BR>

This text contains <SUB> subscript</SUB>

</BODY>

</HTML>

 

Subscript: You can use the <SUP> tag to create a superscript in a Web page. The text specified between the start tag <SUP> and the end tag </SUP> is superscripted and displayed in a smaller size above the normal text. Superscript text matches the font of the enclosing text. The superscript tag is mostly used when writing mathematically equations. The code given will display the use of the <SUB> tag:

<HTML>

<HEAD>

<TITLE> WELCOME TO HTML</TITLE>

</HEAD>

<BODY>

This is an example of creating superscript.

<BR>

This text contains <SUB> superscript</SUB>

</BODY>

</HTML>

Leave a Reply

Your email address will not be published. Required fields are marked *

9 Views
%d bloggers like this: