← All lessons

Lesson 3 · HTML

Text & Headings

~20 min

1. Headings are hierarchy, not size

Use one <h1> per page (main title), then <h2> for sections, <h3> for subsections. Don't skip levels — screen readers rely on it.

<h1>My Portfolio</h1>
<h2>About Me</h2>
<p>I learn HTML with <strong>Infotris</strong> and <em>love</em> structure.</p>
<h3>Skills</h3>
<ul>
  <li>HTML — structure</li>
  <li>CSS — style</li>
</ul>

2. Lists

  • <ul> unordered (bullets) — for items with no order
  • <ol> ordered (numbers) — for steps
  • <li> list item (always inside ul/ol)
  • <dl> <dt> <dd> description list — term & definition

3. Inline vs Block

Block (p, h1, ul, div) starts new line and fills width. Inline (strong, em, a, code, span) flows inside text. You can't put block inside inline.

Interactive Practice

Practice: Text & Headings

Try the examples in your editor and check off when done.

0% complete
Check when done
Quiz

Test Your Understanding

1. How many <h1> should a page have?

2. Which is inline?