<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Abis Dare</title>
    <description>The latest articles on DEV Community by Abis Dare (@aodare90).</description>
    <link>https://dev.to/aodare90</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4260118%2F6b96a231-01de-46a8-b87d-cd3182ead68b.jpg</url>
      <title>DEV Community: Abis Dare</title>
      <link>https://dev.to/aodare90</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aodare90"/>
    <language>en</language>
    <item>
      <title>Stop Memorising HTML: Understand Content Models</title>
      <dc:creator>Abis Dare</dc:creator>
      <pubDate>Tue, 01 Dec 2026 16:15:05 +0000</pubDate>
      <link>https://dev.to/aodare90/stop-memorising-html-understand-content-models-1b1b</link>
      <guid>https://dev.to/aodare90/stop-memorising-html-understand-content-models-1b1b</guid>
      <description>&lt;p&gt;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 &lt;em&gt;validation errors&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;I found myself asking questions like, why can’t a paragraph contain a list?&lt;/p&gt;

&lt;p&gt;Which elements go together? How does HTML nesting even work?&lt;/p&gt;

&lt;p&gt;My understanding changed completely after I relearned HTML properly last year and discovered content models.&lt;/p&gt;

&lt;p&gt;In this article, we will explore three fundamental HTML concepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Semantics&lt;/li&gt;
&lt;li&gt;Content categories&lt;/li&gt;
&lt;li&gt;Content models&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Semantics: Understanding Meaning&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;HTML is a markup language for describing the structure and meaning of a webpage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F76nngmim23p9o5enyqor.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F76nngmim23p9o5enyqor.png" alt="HTML Document Structure" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The biggest shift is: instead of asking, “&lt;strong&gt;&lt;em&gt;What tag should I use&lt;/em&gt;&lt;/strong&gt;?”, we should ask, “&lt;strong&gt;&lt;em&gt;What does this content represent&lt;/em&gt;&lt;/strong&gt;?” &lt;/p&gt;

&lt;p&gt;Understanding meaning makes choosing the appropriate HTML tag much easier.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Content Categories: What Kind of Element&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;HTML elements are grouped into content categories. These categories describe similar or shared characteristics and roles within the HTML document, as seen below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0qt4kctdd8zzlj0cgd2m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0qt4kctdd8zzlj0cgd2m.png" alt="Content Categories" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An element can belong to more than one content category. For example, the &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; element belongs to the flow, phrasing, and interactive content categories, among others.&lt;/p&gt;

&lt;p&gt;You might now be wondering why &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; belongs to so many categories.&lt;/p&gt;

&lt;p&gt;The answer is simple: its purpose. Rather than defining rules for each element individually, HTML can define rules for entire content categories.&lt;/p&gt;

&lt;p&gt;A  &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; 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.&lt;/p&gt;

&lt;p&gt;This leads to content models.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Content Models: What an Element Can Contain&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Content Models (&lt;em&gt;hello, article title!&lt;/em&gt;) specify what an element can contain.&lt;/p&gt;

&lt;p&gt;Why is this so important?&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Content models operate the same way. Look at the example below.&lt;/p&gt;

&lt;p&gt;Why is a paragraph &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; allowed inside a list item &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; &lt;br&gt;
BUT a list item &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; is not allowed inside a paragraph &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;? &lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbpolv4perquh90rfj3s2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbpolv4perquh90rfj3s2.png" alt="HTML Syntax Content Model" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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).&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Understand, don't Memorise!&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The takeaway here is:&lt;br&gt;
&lt;strong&gt;Semantic HTML&lt;/strong&gt;: describe the meaning of elements&lt;br&gt;
&lt;strong&gt;Content Categories&lt;/strong&gt;: classify the HTML elements&lt;br&gt;
&lt;strong&gt;Content Models&lt;/strong&gt;: control how the elements are combined&lt;/p&gt;

&lt;p&gt;Understanding the fundamental concepts behind HTML document structure is essential to being successful as an HTML author.&lt;/p&gt;

&lt;p&gt;The HTML specification documents are a GREAT resource for anyone to use.&lt;br&gt;
Whether you’re a beginner just starting or you’re an expert veteran.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Further Reading&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://html.spec.whatwg.org/multipage/dom.html#content-models" rel="noopener noreferrer"&gt;HTML Living Standard — Content Models&lt;/a&gt;&lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Guides/Content_categories" rel="noopener noreferrer"&gt;MDN — HTML Content Categories&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Personally, I feel this is a much better way to learn HTML in my opinion.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Would Love to Hear from You&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Let me know in the comments your personal learning &lt;em&gt;aha!&lt;/em&gt; moments!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Let's Stay in Touch!&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;LinkedIn&lt;/strong&gt; -&amp;gt; &lt;a href="https://www.linkedin.com/in/bisade/" rel="noopener noreferrer"&gt;Abis Dare&lt;/a&gt;&lt;/p&gt;

</description>
      <category>html</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
