How to mark text superscript in HTML?

HTMLWeb DevelopmentFront End Technology

To mark superscripted text in HTML, use the <sup>…</sup> tag. Just keep in mind both the opening and closing tag is mandatory while using the <sup>...</sup> tag.

The superscript text appears to be half a character above the normal line. It is displayed as a smaller font.

You can try the following code to mark superscripted text in HTML. Here, we are writing the value 2 4 using the <sup> tag,

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <title>HTML text superscript</title>
   </head>
   <body>
      <h1>Heading</h1>
      <p>
         Value: 2 <sup>4</sup> = 16
      </p>
   </body>
</html>
raja
Published on 23-Apr-2018 14:28:58
Advertisements