Open In App

HTML sup Tag

Last Updated : 19 Jul, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

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: 

html
&lt;!DOCTYPE html&gt;
&lt;html&gt;

&lt;head&gt;
    &lt;title&gt;HTML sup Tag&lt;/title&gt;
&lt;/head&gt;

&lt;body style=&quot;text-align: center;&quot;&gt;
    
    &lt;h1 style=&quot;color: green;&quot;&gt;
        GeeksforGeeks
    &lt;/h1&gt;

    &lt;h3&gt;HTML &amp;lt;sup&amp;gt; Tag&lt;/h3&gt;

    &lt;p&gt;a&lt;sup&gt;2&lt;/sup&gt;&lt;/p&gt;
&lt;/body&gt;

&lt;/html&gt;

Output:

  

Example 2: 

html
&lt;!DOCTYPE html&gt;
&lt;html&gt;

&lt;head&gt;
    &lt;title&gt;
        HTML sup Tag
    &lt;/title&gt;
    
    &lt;style&gt;
        sup {
            vertical-align: super;
            font-size: medium;
        }
    &lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;p&gt;
        Examples to demonstrate 
        superscript text
    &lt;/p&gt;
    
    &lt;p&gt;2 &lt;sup&gt;4&lt;/sup&gt;=16&lt;/p&gt;
    &lt;p&gt;X &lt;sup&gt;4&lt;/sup&gt;+ Y&lt;sup&gt;6&lt;/sup&gt;&lt;/p&gt;
    &lt;p&gt;9&lt;sup&gt;th&lt;/sup&gt; of september&lt;/p&gt;

    &lt;p&gt;
        Change the default CSS settings 
        to see the effect.
    &lt;/p&gt;
&lt;/body&gt;

&lt;/html&gt;

Output:

  

Supported Browsers:

  • Google Chrome
  • Edge 12 and above
  • Internet Explorer
  • Firefox 1 and above
  • Apple Safari
  • Opera

Next Article
Practice Tags :

Similar Reads