<?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: Brian Njuguna</title>
    <description>The latest articles on DEV Community by Brian Njuguna (@brian_njuguna_606a88b7a2c).</description>
    <link>https://dev.to/brian_njuguna_606a88b7a2c</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%2F4175954%2F203e3b46-26dd-43f7-8094-a1a04b865eb1.png</url>
      <title>DEV Community: Brian Njuguna</title>
      <link>https://dev.to/brian_njuguna_606a88b7a2c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/brian_njuguna_606a88b7a2c"/>
    <language>en</language>
    <item>
      <title>Understanding Semantic HTML and Accessibility.</title>
      <dc:creator>Brian Njuguna</dc:creator>
      <pubDate>Sat, 10 Oct 2026 20:39:53 +0000</pubDate>
      <link>https://dev.to/brian_njuguna_606a88b7a2c/understanding-semantic-html-and-accessibility-4n29</link>
      <guid>https://dev.to/brian_njuguna_606a88b7a2c/understanding-semantic-html-and-accessibility-4n29</guid>
      <description>&lt;h1&gt;
  
  
  Understanding Semantic HTML and Web Accessibility
&lt;/h1&gt;

&lt;p&gt;As I continue learning web development, I have discovered that creating a website is not only about making it look good. A website should also be well-structured, understandable, and accessible to different users.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Semantic HTML?
&lt;/h2&gt;

&lt;p&gt;Semantic HTML means using HTML elements according to their meaning and purpose. Examples include &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;These elements help developers understand the structure of a webpage. They also help browsers and assistive technologies, such as screen readers, interpret and navigate the content.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before and After: Improving HTML Structure
&lt;/h2&gt;

&lt;p&gt;Before, a webpage might use generic &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; elements for everything:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;My Website&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;Welcome to my page&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code works, but the elements do not explain the purpose of each section.&lt;/p&gt;

&lt;p&gt;After, we can use semantic elements:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;My Website&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Welcome to my page&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The improved version makes the page structure clearer and easier to maintain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three Accessibility Issues and Their Fixes
&lt;/h2&gt;

&lt;p&gt;During my accessibility learning and audit, I focused on three common problems:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Images without alternative text&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An image without useful alternative text may be difficult for someone using a screen reader to understand. I learned to add descriptive &lt;code&gt;alt&lt;/code&gt; text to meaningful images. Decorative images can use an empty &lt;code&gt;alt=""&lt;/code&gt; attribute.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Form fields without labels&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When form fields lack properly associated labels, users may not know what information to enter. I learned to connect each &lt;code&gt;&amp;lt;label&amp;gt;&lt;/code&gt; to its input using matching &lt;code&gt;for&lt;/code&gt; and &lt;code&gt;id&lt;/code&gt; values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;label&lt;/span&gt; &lt;span class="na"&gt;for=&lt;/span&gt;&lt;span class="s"&gt;"email"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Email:&lt;span class="nt"&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"email"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"email"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"email"&lt;/span&gt; &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Poor heading structure&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Headings help users scan and navigate a page. Skipping heading levels without a good reason can make the structure confusing. Using a logical hierarchy, starting with a main &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; and appropriate subheadings, makes content easier to follow.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;Semantic HTML and accessibility are important parts of responsible web development. Meaningful elements improve code organization, while descriptive image text, labelled form fields, and logical headings help more people use a website.&lt;/p&gt;

&lt;p&gt;As a beginner, I am continuing to practise these techniques while building my own portfolio.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;View my portfolio:&lt;/strong&gt; &lt;a href="https://briannjuguna882-a11y.github.io/iyf-s12-week-01-your-github-briannjuguna882-a11y/" rel="noopener noreferrer"&gt;https://briannjuguna882-a11y.github.io/iyf-s12-week-01-your-github-briannjuguna882-a11y/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am looking forward to learning more and improving my skills in HTML, CSS, and accessible web design.&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>frontend</category>
      <category>html</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
