HTML Formatting


🔹 What is HTML Formatting?

HTML formatting tags are used to style text to appear bold, italic, underlined, and more. These tags help emphasize or structure text content in a meaningful way.


🔹 Common Formatting Tags

Tag Description Example Use
<b> Bold text (no semantic meaning) <b>Important</b>
<strong> Strong importance (bold, semantic) <strong>Warning!</strong>
<i> Italic text (no semantic meaning) <i>Italic word</i>
<em> Emphasized text (italic, semantic) <em>Note this</em>
<mark> Highlighted text <mark>Highlighted</mark>
<u> Underlined text <u>Underline</u>
<small> Smaller text <small>Fine print</small>
<del> Deleted text (strike-through) <del>Old Price</del>
<ins> Inserted (underlined) text <ins>New Content</ins>
<sub> Subscript text H<sub>2</sub>O
<sup> Superscript text X<sup>2</sup>

🔹 Examples of Usage
<p>This is a <b>bold</b> word.</p>
<p>This is a <strong>strong</strong> warning.</p>
<p>This is an <i>italic</i> word.</p>
<p>This is an <em>emphasized</em> phrase.</p>
<p>This is <mark>highlighted</mark> text.</p>
<p>This is <u>underlined</u> text.</p>
<p>This is <small>small</small> text.</p>
<p>This is <del>deleted</del> and <ins>inserted</ins> text.</p>
<p>Water formula: H<sub>2</sub>O</p>
<p>Square: X<sup>2</sup></p>

🔹 Semantic vs Non-Semantic Tags

Semantic Non-Semantic
<strong> <b>
<em> <i>

Semantic tags provide meaning to browsers and search engines.


Practice Questions

Q1. Make a word bold using the <b> tag.

Q2. Create a paragraph with a <strong> warning.

Q3. Italicize a sentence using the <i> tag.

Q4. Emphasize the word “important” using <em>.

Q5. Highlight a phrase using the <mark> tag.

Q6. Use <u> to underline a sentence.

Q7. Display a note in smaller font using <small>.

Q8. Strike through the text “Old Price” with <del>.

Q9. Write a subscript formula for H₂O using <sub>.

Q10. Write "E = mc²" using <sup> for the 2.


Go Back Top