HTML chapters

Chapter 1 of 17

HTML and the document tree

Try this in our HTML Compiler →

The idea

HTML describes meaning and structure, not a sequence of executable instructions. A browser parses elements into a document tree. Headings identify sections; paragraphs contain prose. CSS changes presentation and JavaScript adds behaviour. Start with meaningful content before styling it.

Worked example

<h1>My study journal</h1>
<p>Today I built my first page.</p>

What to check

The heading and paragraph become separate elements. Changing their order changes the reading order. HTML alone does not calculate values or repeat instructions.

Practice task

Add a second paragraph describing one thing you want to learn. Keep just one main heading for this page.

Check your understanding

Explain the result in your own words before changing the example. Change one thing at a time, compare the result with your prediction, and keep the version that demonstrates the concept clearly.

Try it yourself

Output
Ctrl/Cmd+Enter runs · Ctrl/Cmd+S downloads the project · Local auto-save is always on