Skip to content
Related Articles

Related Articles

Improve Article

HTML sup Tag

  • Difficulty Level : Expert
  • Last Updated : 27 Nov, 2020

The <sup> tag in HTML describes the text as a superscript text. Here the text is above the baseline of the text and that text appears in a smaller font.

Syntax:

<sup> Content... </sup>

Example 1:




<!DOCTYPE html>
<html>
  
<head>
    <title>HTML sup Tag</title>
</head>
  
<body style="text-align: center;">
      
    <h1 style="color: green;">
        GeeksforGeeks
    </h1>
  
    <h3>HTML <sup> Tag</h3>
  
    <p>a<sup>2</sup></p>
</body>
  
</html>

Output:

Example 2:






<!DOCTYPE html>
<html>
  
<head>
    <title>
        HTML sup Tag
    </title>
      
    <style>
        sup {
            vertical-align: super;
            font-size: medium;
        }
    </style>
</head>
  
<body>
    <p>
        Examples to demonstrate 
        superscript text
    </p>
      
    <p>2 <sup>4</sup>=16</p>
    <p>X <sup>4</sup>+ Y<sup>6</sup></p>
    <p>9<sup>th</sup> of september</p>
  
    <p>
        Change the default CSS settings 
        to see the effect.
    </p>
</body>
  
</html>

Output:

Supported Browsers:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera

Attention reader! Don’t stop learning now. Get hold of all the important Comcompetitivepetitve Programming concepts with the Web Design for Beginners | HTML  course.




My Personal Notes arrow_drop_up
Recommended Articles
Page :