<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abhay Lokesh on Medium]]></title>
        <description><![CDATA[Stories by Abhay Lokesh on Medium]]></description>
        <link>https://medium.com/@abjhontyharsh?source=rss-3d16ce65ecb3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*2kdnqOSegVrp5fbhFGSsRA.jpeg</url>
            <title>Stories by Abhay Lokesh on Medium</title>
            <link>https://medium.com/@abjhontyharsh?source=rss-3d16ce65ecb3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 06:33:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abjhontyharsh/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[HTML — The Hygienic Way]]></title>
            <link>https://medium.com/@abjhontyharsh/html-the-hygienic-way-f1aad2ea834e?source=rss-3d16ce65ecb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1aad2ea834e</guid>
            <category><![CDATA[accessibility]]></category>
            <category><![CDATA[dom]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[html5]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Abhay Lokesh]]></dc:creator>
            <pubDate>Wed, 19 Feb 2020 11:24:30 GMT</pubDate>
            <atom:updated>2020-02-24T16:15:07.921Z</atom:updated>
            <content:encoded><![CDATA[<h3>HTML — The Pragmatic Way</h3><p>Cleaner way to build Application DOM</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*wtbphh9buB7NAjHoCtv74w.png" /><figcaption>HTML Logo</figcaption></figure><p>So recently I was having this conversation with a fellow colleague about HTML and why use a particular tag and over the next few days another colleague of mine posted something on LinkedIn which motivated me to write this blog.</p><p>So we all know what is HTML- Its a markup language. It has got no error throwing mechanism nothing its simple markup which is just interpreted on the screen.</p><p>I have seen people writing all kinds of tags and stuff. Now is an era of web-components so having a pragmatic and a hygienic approach is very essential.</p><p><strong><em>What do I mean by pragmatic and a hygienic ?</em></strong></p><p>Using of proper tags for the respective purpose. HTML 5 has an array of elements which are there for a particular purpose be it the header,main,section and aside for example. These as the name suggest has a specific actions that they perform while creating the DOM tree.</p><p><strong><em>So how does it help to have a structured approach to HTML?</em></strong></p><p>As stated above HTML 5 introduced what we call <strong>semantic tags</strong>.These help in the following ways:</p><ul><li>A better DOM construction.</li><li>Allows the <strong>HTML</strong> <strong>parser</strong> to create the DOM with minimalistic resource usage.</li><li><strong>DOM</strong> <strong>traversal</strong> becomes faster as well as the DOM tree is very neat.</li><li>Browser can add importance to the respective tags.</li><li>Your <strong>tabbing</strong> <strong>order</strong> improves as browser will be able to do it based on the priority a tag has.</li><li>Most importantly your web page becomes more <strong>accessible</strong> making life easier for <strong>screen readers</strong>. Add <strong>ARIA tags</strong> to it and your app <strong>accessibility</strong> increase multi folds.</li><li>It also affects <strong>SEO</strong> as your DOM construction time decrease.</li><li>Certain tags such as <strong>button,a </strong>which have a behavior attached to it can also be used effectively.</li></ul><p><strong><em>How can we achieve it?</em></strong></p><p>Simple HTML 5 semantic tags goes a long way.The below schematics show some of the structure that you can use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G1qJpEtrdtVGgk7lC7OfVA.png" /><figcaption>Basic structure of a web page.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iMyDxGNS7UWQDNJWWXvf9w.png" /><figcaption>main structure</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Qu6EbWr90o9P8PC9K1Msg.png" /><figcaption>Navigation structure</figcaption></figure><p>As you can see above we have followed some important set of flow that provides a top to bottom approach to the web page.</p><ul><li>We have a single <strong>header</strong> and <strong>footer</strong> tag. That provide the screen readers as well as HTML parser a starting point and an ending point. We do not have multiple footer and header tags in the same web page.</li><li>The <strong>main</strong> tag wraps around the main content of the web page with as many <strong>section </strong>tags<strong> </strong>and <strong>aside</strong> tags as the app requires.</li><li>The asides, if they are performing the navigation of site to change the content then they follow the navigation structure as shown above.</li><li>The navigation structure again has a top to bottom flow with the <strong>nav</strong> tag leading to (a list) <strong>ul </strong>of navigation items <strong>li</strong> which wraps the <strong>anchor</strong> tags.</li><li>Having heading tags (ensuring we are starting from <strong>h1 tag and further to h2, h3 and so on.</strong>) in the web page will also increases accessibility.</li><li>Adding <strong>role attribute</strong> and <strong>ARIA attributes</strong> also increase the accessibility.</li></ul><p>These help in improving the code quality from a browser perspective, accessibility perspective and as a <strong><em>side effect</em></strong> increases <strong>readability</strong> of your code and a hygienic way of coding which peers can follow.</p><p>Here are a few <strong><em>emmet snippets</em></strong> that you can use in your HTML construction.</p><pre>1. base structure - header+(main&gt;(aside+section))+footer<br>2. navigation - nav&gt;ul&gt;(li&gt;a)*x - Here replace x with number<br>3. main structure - section&gt;((section&gt;h1+div&gt;p)*x)*y<br>4. aside structure - aside&gt;nav&gt;ul&gt;(li&gt;a)*x</pre><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1aad2ea834e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>