Skip to content

Courses / HTML5 Mastery: Complete Beginner to Advanced Course / HTML Text Basics

619 people viewed this

HTML Text Basics

Use <small> for side comments, fine print, disclaimers, or similar content.

<p>Course price: ₹499</p>
<p><small>Prices may change without notice.</small></p>

<small> is not intended as a general-purpose tool for making any text smaller. Use CSS when the only goal is changing font size.

Superscript: The Sup Element

Use <sup> for superscript text, such as exponents or certain footnote markers.

<p>Mathematics: x<sup>2</sup> + y<sup>2</sup> = z<sup>2</sup></p>

<p>This claim needs a source.<sup>1</sup></p>

Subscript: The Sub Element

Use <sub> for subscript text, such as chemical formulas.

<p>Water: H<sub>2</sub>O</p>

<p>Carbon dioxide: CO<sub>2</sub></p>

Use these elements for text that genuinely has superscript or subscript meaning. Do not use them simply to adjust the visual position of ordinary text.


7. Inserted, Deleted and Underlined Text

The Ins Element

The <ins> element represents text that has been inserted into a document.

<p>Course fee:
  <del>₹999</del>
  <ins>₹499</ins>
</p>

The Del Element

The <del> element represents text that has been deleted from a document.

Browsers commonly display deleted text with a strikethrough and inserted text with an underline, but the elements convey editorial meaning, not merely visual styling.

The U Element

The <u> element represents a non-textual annotation, such as a proper name that needs a specific annotation or a misspelled word in an editing interface. It is not intended as a generic underline tool.

<p>The document contains a
  <u>missspelled</u> word.
</p>

If you only want underlined styling, use CSS. Underlines can be mistaken for links, so use them carefully.

Practical Example: Showing a Price Change

<p>
  Previous price:
  <del>₹1,499</del>
</p>

<p>
  Current price:
  <ins>₹999</ins>
</p>

Rate this course

5.0 · 1 rating

Stars show on this course. Your written note stays private.

Your stars