Skip to content

Day 3: Text Formatting & Headings

Master typographic hierarchy, inline text emphasis, spacing breaks, and code comments.

Headings define the structural hierarchy of your content:

  • <h1>: Main title of the page (use only once per document).
  • <h2>: Major sections.
  • <h3>: Subsections within an <h2>.
  • <h4> to <h6>: Further detailed sub-levels.
<h1>Mastering Web Development</h1>
<h2>Week 1: HTML Fundamentals</h2>
<h3>Day 3: Working with Text</h3>
  • <p>: Standard body paragraph.
  • <strong>: Strong importance (renders bold, announces importance to screen readers).
  • <em>: Emphasized text (renders italic, announces vocal stress).
  • <br>: Line break (use only for poems, postal addresses, or line breaks where semantic separation is not desired).
  • <hr>: Thematic break or horizontal rule between sections.
<!-- This is an HTML comment. It will not show up on the page -->
<p>
Learning HTML requires <strong>regular practice</strong>.
Remember to take <em>short breaks</em>.
</p>
<hr />
  1. Write an article draft about your favorite hobby using an <h1>, three <h2> sections, and multiple <p> paragraphs.
  2. Emphasize important terms using <strong> and <em>.
  3. Separate sections using <hr /> and add HTML comments documenting your code.