<?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: Claire </title>
    <description>The latest articles on DEV Community by Claire  (@gakuruclaire39cmd).</description>
    <link>https://dev.to/gakuruclaire39cmd</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%2F4213727%2F10396f91-fd57-4405-a5c1-920a342a28b4.png</url>
      <title>DEV Community: Claire </title>
      <link>https://dev.to/gakuruclaire39cmd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gakuruclaire39cmd"/>
    <language>en</language>
    <item>
      <title>Sematic HTML and Accessibility: What I Learned and Fixed</title>
      <dc:creator>Claire </dc:creator>
      <pubDate>Wed, 28 Oct 2026 19:24:53 +0000</pubDate>
      <link>https://dev.to/gakuruclaire39cmd/title-what-i-learned-fixing-my-html-forms-semantic-html-accessibility-md9</link>
      <guid>https://dev.to/gakuruclaire39cmd/title-what-i-learned-fixing-my-html-forms-semantic-html-accessibility-md9</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I am learning HTML to learn different coding languages and to be able to apply them. In Week 01 we started with HTML, and I thought I knew forms until I did an accessibility audit on my contact form.&lt;/p&gt;

&lt;p&gt;Here is what I learned.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Semantic HTML and why it matters?
&lt;/h3&gt;

&lt;p&gt;Semantic HTML means using tags for their meaning, not just for looks. Instead of using &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; for everything, you use &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;fieldset&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;legend&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;label&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It matters because:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Screen readers can understand your page&lt;/li&gt;
&lt;li&gt;Your form can validate automatically without JavaScript&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Before vs After - My Contact Form
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Before (non-semantic):&lt;/strong&gt;&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;
  Full Name
  &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;"text"&lt;/span&gt; &lt;span class="na"&gt;placeholder=&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&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;
  Message
  &lt;span class="nt"&gt;&amp;lt;textarea&amp;gt;&amp;lt;/textarea&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;Problem: No label is linked to input, no grouping, no required check.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;After (semantic - what I use now):&lt;/strong&gt;&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;fieldset&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;legend&amp;gt;&lt;/span&gt;Personal Information&lt;span class="nt"&gt;&amp;lt;/legend&amp;gt;&lt;/span&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;"fullName"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Full Name *&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;"text"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"fullName"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"fullName"&lt;/span&gt; &lt;span class="na"&gt;required&lt;/span&gt; &lt;span class="na"&gt;autocomplete=&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&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;"message"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Message * (min 50 characters)&lt;span class="nt"&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;textarea&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"message"&lt;/span&gt; &lt;span class="na"&gt;required&lt;/span&gt; &lt;span class="na"&gt;minlength=&lt;/span&gt;&lt;span class="s"&gt;"50"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/textarea&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/fieldset&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the label is linked with &lt;code&gt;for="fullName"&lt;/code&gt; matching &lt;code&gt;id="fullName"&lt;/code&gt;, and the browser validates automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  Accessibility Issues I Found and Fixed
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Unlinked labels&lt;/strong&gt;&lt;br&gt;
My audit showed labels were not connected to inputs. Screen readers couldn't read them. I fixed it by adding &lt;code&gt;for&lt;/code&gt; and &lt;code&gt;id&lt;/code&gt; with same value.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Missing fieldset and legend&lt;/strong&gt;&lt;br&gt;
I had all inputs in divs. I grouped them into &lt;code&gt;&amp;lt;fieldset&amp;gt;&lt;/code&gt; with &lt;code&gt;&amp;lt;legend&amp;gt;Personal Information&amp;lt;/legend&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;legend&amp;gt;Your Message&amp;lt;/legend&amp;gt;&lt;/code&gt;. Now users know which section they are in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. No alt text and bad form attributes&lt;/strong&gt;&lt;br&gt;
I had &lt;code&gt;method="posts"&lt;/code&gt;, typo &lt;code&gt;reqiured&lt;/code&gt;, and &lt;code&gt;fieldest&lt;/code&gt;. Also my images had no description. I fixed to &lt;code&gt;method="post"&lt;/code&gt;, &lt;code&gt;required&lt;/code&gt;, &lt;code&gt;fieldset&lt;/code&gt;, and added &lt;code&gt;alt="Portrait photo of Claire Wairimu"&lt;/code&gt;. I also added &lt;code&gt;autocomplete&lt;/code&gt; for better UX.&lt;/p&gt;

&lt;h3&gt;
  
  
  My Deployed Portfolio
&lt;/h3&gt;

&lt;p&gt;You can see the fixed 4-page portfolio here:&lt;br&gt;
&lt;a href="https://gakuruclaire39-cmd.github.io/Iyf-s12-week-01-gakuruclaire39-cmd/" rel="noopener noreferrer"&gt;https://gakuruclaire39-cmd.github.io/Iyf-s12-week-01-gakuruclaire39-cmd/&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;4 pages with styled nav + active state&lt;/li&gt;
&lt;li&gt;Accessible contact form&lt;/li&gt;
&lt;li&gt;Semantic heading hierarchy &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you are working on your web foundations, run Lighthouse in Chrome DevTools early. It catches all these issues in seconds.&lt;/p&gt;

&lt;p&gt;As I continue learning, I intend to apply all the principles to my project.&lt;/p&gt;

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