HTML5: How to define superscripted text?
Solution:
HTML Code:
Explanation:
- This HTML code defines a webpage with a paragraph containing superscripted text.
- The <sup> tag is used to define superscripted text within the paragraph.
- The text "superscript" inside the <sup> tags will be displayed in a smaller font size and raised position compared to the surrounding text.
- The text "a<sup>2</sup>+b<sup>2</sup>" demonstrates the use of superscript for mathematical expressions, where "2" is displayed in superscript.
Live Demo:
See the solution in the browser
Supported browser
![]() |
![]() |
![]() |
![]() |
![]() |
Yes | Yes | Yes | Yes | Yes |
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.