Articles → HTML → Subscript And Superscript Tags In HTML

Subscript And Superscript Tags In HTML






Purpose





Syntax


<!--for super script-->
<sup>text</sup>
<!--for sub script-->
<sub>text</sub>



Example


<html>
	<head>
		<title>superscript and subscript demo</title>
	</head>
	<body>
		<!--for super script-->
    X
		<sup>2</sup> + Y 
		<sup>2</sup>
		<br />
		<!--for sub script-->
    H
		<sub>2</sub>O

	</body>
</html>

Try It

Picture showing the output of Subscript and superscript in HTML
Click to Enlarge


Browser Support


Internet ExplorerFirefoxChromeSafariOperaEdge
YesYesYesYesYesYes



Posted By  -  Karan Gupta
 
Posted On  -  Thursday, October 13, 2016
 
Updated On  -  Friday, September 29, 2017

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250