Share on Google+Share on Google+

HTML5 sup element, Example of <sub>  and <sup> tag of HTML5.

Advertisement
In this section, you will see the use of <sub>  and <sup> of html5.

HTML5 sup element, Example of <sub>  and <sup> tag of HTML5.

Introduction:

In this tutorial, you will see how to use <sub> and <sup> tag. The <sub> is used for defining subscript text. But 2 tag is used for superscript text in your document.

Declaration Syntax :

Declaration syntax of <sub> in HTML5.

                           <sub>subscript text</sub>


Declaration syntax of <sup> in HTML5.

                           <sup> superscript text</sup>

Example of <span> in HTML5:

Code:
Sub&Sup_Tag.html
<!doctype html >
<html>
<head><title>Insert title of document</title></head>
<body>
<h2>HTML5 &lt;sub&gt; and &lt;sup&gt; tag example.</h2>
<p>Subscript</p>
H<sub>2</sub>SO<sub>4</sub>
<p>Superscript</p>
Num<sup>2</sup>.
</body>
</html>
Output:

Download this code

Difference Between HTML5 and HTML4.01:

None.

Advertisements

Posted on: September 14, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.