HTML has six levels of headings, from <h1> (the most important) down to <h6>. They work like the outline of a document:
<h1>My Travel Blog</h1>
<h2>Italy</h2>
<h3>Rome</h3>
<h3>Venice</h3>
<h2>Japan</h2>
Use one <h1> for the title of the page, <h2> for its main sections, and <h3> for parts inside a section. Pick the level by meaning, not by size. You will change sizes later with CSS.
Headings matter more than they look. Search engines read them to understand a page, and people who use screen readers jump from heading to heading to find what they need.
Spaces and new lines
The browser ignores extra spaces and line breaks in your code. These two lines of code show up as one line of text:
<p>Roses are red,
violets are blue.</p>
To start a new block of text, start a new <p> element.
Your Task
- Keep the
<h1>and add an<h2>heading under it for a section called anything you like. - Add two separate paragraphs under your
<h2>.
- The page still has exactly one
<h1> - There is an
<h2>heading with some text - There are at least two paragraphs with text in them
- The
<h2>comes after the<h1>
Lesson complete!
Next Lesson: Bold, Italic and Line Breaks