Elements form a tree
Opening and closing tags usually surround content, and elements can contain other elements. This nesting creates parent, child, and sibling relationships that both CSS and JavaScript can use.
The document has a basic frame
A page declares its document type, then separates metadata in the head from visible content in the body. The title, language, and character encoding belong to this foundation.
A familiar example
Structuring a short article
- A main element contains the page's central content.
- An article contains a heading and paragraphs.
- Related links sit after the article instead of being mixed into its sentences.
What to remember
- HTML elements describe parts of a document.
- Valid nesting makes structure predictable.
- Start with meaningful structure before adding classes for appearance.