When I first learned HTML, it was a disaster. I tried to memorise all the different HTML tags, and I could never figure out why I kept getting so many validation errors.
I found myself asking questions like, why can’t a paragraph contain a list?
Which elements go together? How does HTML nesting even work?
My understanding changed completely after I relearned HTML properly last year and discovered content models.
In this article, we will explore three fundamental HTML concepts:
- Semantics
- Content categories
- Content models
Semantics: Understanding Meaning
HTML is a markup language for describing the structure and meaning of a webpage.
The biggest shift is: instead of asking, “What tag should I use?”, we should ask, “What does this content represent?”
Understanding meaning makes choosing the appropriate HTML tag much easier.
Content Categories: What Kind of Element
HTML elements are grouped into content categories. These categories describe similar or shared characteristics and roles within the HTML document, as seen below.
An element can belong to more than one content category. For example, the <button> element belongs to the flow, phrasing, and interactive content categories, among others.
You might now be wondering why <button> belongs to so many categories.
The answer is simple: its purpose. Rather than defining rules for each element individually, HTML can define rules for entire content categories.
A <button> can be used in a paragraph as phrasing content appearing alongside text, or enable interaction as interactive content. These categories matter because they let HTML define what elements can go inside other elements.
This leads to content models.
Content Models: What an Element Can Contain
Content Models (hello, article title!) specify what an element can contain.
Why is this so important?
Content models preserve HTML document structure. Think of an editorial style guide at a newspaper; it sets the rules for what you can and cannot do to preserve the publication's standards.
Content models operate the same way. Look at the example below.
Why is a paragraph <p> allowed inside a list item <li>
BUT a list item <li> is not allowed inside a paragraph <p>?
A list item's content model is flow content. A paragraph’s content model, however, is phrasing content. They serve two different purposes. A list may require paragraphs to explain or describe its content – think of a shopping list with extra instructions for each item entry. A paragraph’s purpose is to present text as a passage. A list is a specific rigid organisational structure that is incompatible with a paragraph.
You can test this yourself by writing sample HTML and then opening up the browser to render it. The HTML parser will automatically separate them because it is invalid HTML structure (select developer tools or F12 in the browser to view this).
Understand, don't Memorise!
The takeaway here is:
Semantic HTML: describe the meaning of elements
Content Categories: classify the HTML elements
Content Models: control how the elements are combined
Understanding the fundamental concepts behind HTML document structure is essential to being successful as an HTML author.
The HTML specification documents are a GREAT resource for anyone to use.
Whether you’re a beginner just starting or you’re an expert veteran.
Further Reading
HTML Living Standard — Content Models
MDN — HTML Content Categories
Personally, I feel this is a much better way to learn HTML in my opinion.
Would Love to Hear from You
Let me know in the comments your personal learning aha! moments!
Let's Stay in Touch!
LinkedIn -> Abis Dare



Top comments (2)
Hey Abby, loved this 😀 And the images are really good too, they make everything so easy to follow. Honestly, I would not have guessed this was your 1st article at all! Great job, keep going 🙌
Thank you, Hemapriya, for the feedback!
I was nervous before I wrote this, but now I will keep going.
Thank you so much for the support - I am glad you liked it 😊