HTML Tutorial Part 3: HTML Text Formatting and Headings

HTML Tutorial Part 3

Mastering Text Formatting and Headings

Understanding HTML Headings

HTML provides six levels of headings from <h1> to <h6>. They create a hierarchy of importance on your page.

<h1>Main Page Heading</h1>
<h2>Section Heading</h2>
<h3>Subsection Heading</h3>
<h4>Minor Heading</h4>
<h5>Small Heading</h5>
<h6>Smallest Heading</h6>

Text Formatting Tags

TagPurposeExample
<b>Bold textBold
<strong>Important text (bold)Strong
<i>Italic textItalic
<em>Emphasized text (italic)Emphasized
<u>Underlined textUnderlined
<mark>Highlighted textHighlighted
<small>Smaller textSmall text
<del>Deleted textDeleted
<ins>Inserted textInserted
<sub>SubscriptH2O
<sup>SuperscriptX2

Practical Examples

<p>This is <strong>very important</strong> information.</p>
<p>The formula is H<sub>2</sub>O.</p>
<p>E=mc<sup>2</sup></p>
<p>Price: <del>$100</del> <ins>$75</ins></p>

Demo Output

This is H1

This is H2

This is H3

This is very important information.

The formula is H2O.

E=mc2

Price: $100 $75

Best Practices

  • Use only one <h1> per page for the main title
  • Follow heading hierarchy (don't skip from h1 to h4)
  • Use <strong> and <em> for semantic meaning
  • Use <b> and <i> only for styling
  • Avoid overusing formatting tags

Excellent Work!

You've completed Part 3 of the HTML Tutorial!
Next up: HTML Links and Images

Post a Comment

0 Comments