<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HTML - TheCodeBuzz</title>
	<atom:link href="https://thecodebuzz.com/category/html/feed/" rel="self" type="application/rss+xml" />
	<link>https://thecodebuzz.com</link>
	<description>Best Practices for Software Development</description>
	<lastBuildDate>Sat, 08 Apr 2023 00:44:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://thecodebuzz.com/wp-content/uploads/2022/11/cropped-android-chrome-512x512-1-1-51x51.jpg</url>
	<title>HTML - TheCodeBuzz</title>
	<link>https://thecodebuzz.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>HTML5 Best Practices-Naming Style Convention</title>
		<link>https://thecodebuzz.com/html5-naming-and-style-convention-best-practices/</link>
					<comments>https://thecodebuzz.com/html5-naming-and-style-convention-best-practices/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 03 Dec 2020 18:22:00 +0000</pubDate>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTML Naming and Style Convention]]></category>
		<category><![CDATA[HTML5 Naming and Style Convention]]></category>
		<category><![CDATA[HTML5 Naming guidelines]]></category>
		<guid isPermaLink="false">https://thecodebuzz.com/?p=11183</guid>

					<description><![CDATA[<p>HTML5 Best Practices -Naming and Style Convention Today, we shall see a high-level HTML5 Best Practices-Naming Style Convention to be used for any web application. We will cover the below guidelines for HTML5 usage, Responsive Web UI Design is the key to delivering the best UX User Interface experience to users. HTML defines Web content [&#8230;]</p>
<p>The post <a href="https://thecodebuzz.com/html5-naming-and-style-convention-best-practices/">HTML5 Best Practices-Naming Style Convention</a> first appeared on <a href="https://thecodebuzz.com">TheCodeBuzz</a>.</p>]]></description>
										<content:encoded><![CDATA[<h1 class="wp-block-heading"><strong>HTML5 Best Practices -Naming and Style Convention</strong></h1>



<figure class="wp-block-image size-large is-resized"><a href="https://www.thecodebuzz.com/html5-naming-and-style-convention-best-practices" target="_blank" rel="noopener"><img fetchpriority="high" decoding="async" src="https://www.thecodebuzz.com/wp-content/uploads/2020/06/HTML-5-Naming-and-Style-Convention-Best-Practices.jpg" alt="HTML5 Best Practices-Naming Style Convention" class="wp-image-11192" width="381" height="493" srcset="https://thecodebuzz.com/wp-content/uploads/2020/06/HTML-5-Naming-and-Style-Convention-Best-Practices.jpg 327w, https://thecodebuzz.com/wp-content/uploads/2020/06/HTML-5-Naming-and-Style-Convention-Best-Practices-231x300.jpg 231w" sizes="(max-width: 381px) 100vw, 381px" /></a></figure>



<p>Today, we shall see a high-level<em><strong> HTML5 Best Practices-Naming Style Convention </strong></em>to be used for any web application.</p>



<p></p>



<p>We will cover the below guidelines for HTML5 usage,</p>



<p></p>



<div class="wp-block-aioseo-table-of-contents"><ul><li><a href="#aioseo-use-html-document-type-declaration">Use HTML document Type declaration</a></li><li><a href="#aioseo-define-only-one-html-per-page">Define only one <html> per page</a></li><li><a href="#aioseo-define-titlehtml-element">Define <title>HTML Element</a></li><li><a href="#aioseo-define-body-html-element">Define <body> HTML Element</a></li><li><a href="#aioseo-viewport--responsive-web-design">Viewport -Responsive Web Design</a></li><li><a href="#aioseo-descriptive-meta-tags">Descriptive Meta Tags</a></li><li><a href="#aioseo-html-elements-as-lower-case">HTML Elements as Lower case</a></li><li><a href="#aioseo-html-elements---close-html-elements">HTML Elements &#8211; Close HTML elements</a></li><li><a href="#aioseo-html-empty-elements---close-empty-html-elements">HTML Empty Elements &#8211; Close Empty HTML elements</a></li><li><a href="#aioseo-html-attribute-as-lower-case">HTML Attribute  as Lower case</a></li><li><a href="#aioseo-html-attribute-values-should-be-quoted">HTML Attribute Values should be Quoted</a></li><li><a href="#aioseo-use-text-as-alternatives">Use Text as Alternatives</a></li><li><a href="#aioseo-use-only-one-h1-per-page-or-post">Use only one H1 per Page or Post</a></li><li><a href="#aioseo-structure-your-html">Structure your HTML</a></li><li><a href="#aioseo-design-html-for-fallback-mechanism">Design HTML for Fallback mechanism</a></li><li><a href="#aioseo-design-your-html-stateless">Design your HTML Stateless</a></li></ul></div>



<p></p>



<p>Responsive Web UI Design is the key to delivering the best UX User Interface experience to users. <strong>HTML</strong> defines Web content and <strong>CSS </strong>usage puts the design of Web content. You must try to follow the best practices of HTML5 Naming and Style Convention for delivering the best experience to UI users.</p>



<p></p>



<p></p>



<p>The below guidelines are meant to be more for fresh learners.</p>



<p></p>



<h2 class="wp-block-heading" id="aioseo-use-html-document-type-declaration">Use HTML document Type declaration</h2>



<p></p>



<p>All <strong><em>HTML5 </em></strong>document must use declaration <em><strong>&lt;!DOCTYPE html&gt;</strong></em></p>



<p></p>



<pre class="wp-block-preformatted has-medium-font-size">&lt;!DOCTYPE html&gt;</pre>



<p></p>



<p>Browsers behave more predictably and consistently when it parses HTML documents using <strong><em>Doctype</em></strong> declaration.</p>



<p></p>



<p>The <strong>doctype </strong>is an important component of a quality HTML document.</p>



<p></p>



<p>One can also use a lower version of HTML if needed to be supported.</p>



<p></p>



<pre class="wp-block-preformatted has-medium-font-size">&lt;!-- HTML 4* version supported --&gt;&gt;

&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"&gt;
</pre>



<p></p>



<h2 class="wp-block-heading" id="aioseo-define-only-one-html-per-page">Define only one &lt;html&gt; per page</h2>



<p></p>



<p>Define only one &lt;html&gt; per webpage as a good practice.</p>



<p>This property is very useful for SEO(search engine) and can be used to specify the language of a web page helping read the page in different languages.</p>



<p></p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: csharp; title: ; notranslate">
&lt;!DOCTYPE html&gt;
&lt;html&gt;

    &lt;head&gt;
        &lt;!-- your link to stylesheet, jquery etc --&gt;
    &lt;/head&gt;

    &lt;body&gt;
        &lt;!-- your content --&gt;
    &lt;/body&gt;

&lt;/html&gt;

</pre></div>


<p></p>



<h2 class="wp-block-heading" id="aioseo-define-titlehtml-element">Define &lt;title&gt;HTML Element</h2>



<p></p>



<p>Its recommended to use &lt; <strong><em>title</em></strong>&gt; element in the webpage.</p>



<p>There are multiple benefits of using the &lt; title&gt; element as listed below,</p>



<p></p>



<ul class="wp-block-list"><li>Displays the <strong><em>Title </em></strong>for the page in the search result (using google or bing or another search engine).</li></ul>



<ul class="wp-block-list"><li>The browser tab shows the name of the page as defined in the Title.</li></ul>



<ul class="wp-block-list"><li>When the user adds your webpage to Favorites, it shows the Title as the default name in the browser toolbar </li></ul>



<p></p>



<p>The contents of a page title are very important for search engine optimization (<em><strong>SEO</strong></em>)</p>



<p></p>



<pre class="wp-block-preformatted has-medium-font-size">&lt;title&gt;TheCodeBuzz - Best Practices for Software Development&lt;/title&gt;</pre>



<p></p>



<h2 class="wp-block-heading" id="aioseo-define-body-html-element">Define &lt;body&gt; HTML Element</h2>



<p></p>



<p>Its recommended to use &lt; <strong><em>body</em></strong>&gt; element in the webpage,</p>



<p></p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; highlight: [2,12]; title: ; notranslate">
&lt;!DOCTYPE html&gt;
&lt;html&gt;

    &lt;head&gt;
        &lt;!-- your link to stylesheet, jquery etc --&gt;
    &lt;/head&gt;

    &lt;body&gt;
        &lt;!-- your content --&gt;
    &lt;/body&gt;

&lt;/html&gt;

</pre></div>


<p></p>



<h2 class="wp-block-heading" id="aioseo-viewport--responsive-web-design">Viewport -Responsive Web Design</h2>



<p></p>



<p>The browser&#8217;s viewport is the area of the screen in which web content can be seen by the User. The width property controls the size of the viewport.</p>



<p></p>



<p>It&#8217;s recommended to use this <em><strong>meta tag </strong></em>for responsive web design.</p>



<p></p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; highlight: [1]; title: ; notranslate">
&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;

</pre></div>


<p></p>



<p>Device(<strong><em>Mobile or Tab or Desktop</em></strong>) screen width will be set as the default width for the Web Page automatically.</p>



<p></p>



<h2 class="wp-block-heading" id="aioseo-descriptive-meta-tags">Descriptive Meta Tags</h2>



<p></p>



<p>One can also add meta tags for more descriptions like page descriptions, keywords, author of the document, etc.</p>



<p></p>



<p></p>



<h2 class="wp-block-heading" id="aioseo-html-elements-as-lower-case">HTML Elements as Lower case</h2>



<p></p>



<ul class="wp-block-list"><li>It&#8217;s recommended to use lower case for HTML elements names.</li></ul>



<ul class="wp-block-list"><li>However, HTML5 and lower versions do support the upper casing for the HTML elements.</li></ul>



<ul class="wp-block-list"><li>Lower case elements are easily readable and avoid any confusion.</li></ul>



<p></p>



<pre class="wp-block-preformatted has-medium-font-size">&lt;body&gt;
&lt;p&gt;Hi There, TheCodeBuzz community&lt;/p&gt;
&lt;/body&gt;</pre>



<p></p>



<h2 class="wp-block-heading" id="aioseo-html-elements---close-html-elements">HTML Elements &#8211; Close HTML elements</h2>



<p></p>



<p>It&#8217;s recommended to close the <strong>HTML element&#8217;s Tag</strong> although HTML allows using HTML elements without closing.</p>



<p></p>



<pre class="wp-block-preformatted has-medium-font-size">&lt;p&gt;Hi There, TheCodeBuzz community&lt;/p&gt;</pre>



<pre class="wp-block-preformatted has-medium-font-size">&lt;a href="https://www.thecodebuzz.com"&gt;Visit TheCodeBuzz&lt;/a&gt;</pre>



<p></p>



<h2 class="wp-block-heading" id="aioseo-html-empty-elements---close-empty-html-elements">HTML Empty Elements &#8211; Close Empty HTML elements</h2>



<p></p>



<p>It&#8217;s recommended to close Empty HTML elements.</p>



<p></p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; highlight: [1]; title: ; notranslate">
&lt;br/&gt;
</pre></div>

<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; highlight: [1]; title: ; notranslate">
&lt;wbr/&gt;
</pre></div>


<p></p>



<p></p>



<p></p>



<h2 class="wp-block-heading" id="aioseo-html-attribute-as-lower-case">HTML Attribute  as Lower case</h2>



<p></p>



<ul class="wp-block-list"><li>It&#8217;s recommended using lower case for HTML Attribute names.</li></ul>



<ul class="wp-block-list"><li>However, HTML5 and lower versions do support the upper casing for the HTML Attribute.</li></ul>



<ul class="wp-block-list"><li>Lower case elements are easily readable and avoid any confusion</li></ul>



<p></p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; highlight: [1]; title: ; notranslate">
&lt;a href=&quot;https://www.thecodebuzz.com&quot;&gt;Visit TheCodeBuzz&lt;/a&gt;
</pre></div>


<p></p>



<h2 class="wp-block-heading" id="aioseo-html-attribute-values-should-be-quoted">HTML Attribute Values should be Quoted </h2>



<p></p>



<p>It is recommended to use HTML Attribute Values within the Quote</p>



<p></p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; highlight: [1]; title: ; notranslate">
&lt;a href=&quot;https://www.thecodebuzz.com&quot;&gt;Visit TheCodeBuzz&lt;/a&gt;
</pre></div>


<p> </p>



<h2 class="wp-block-heading" id="aioseo-use-text-as-alternatives">Use Text as Alternatives</h2>



<p></p>



<p>It&#8217;s always recommended to provide text alternatives for any non-text content ex, images, videos, etc.</p>



<p></p>



<p><strong>Example</strong>&#8211;  <strong><em>alt tag </em></strong>for the images.</p>



<p><strong>Description </strong>&#8211; The <em>alt tag specifies an alternate text for the image in case if images can not be displayed for any reason. Search engines recommend</em> using <em>alt </em>tags for images and can rank your page lower as a result.</p>



<p>Such text description also helps convert the few data to text so that it can be available for processing like screen reader could help read text for non-readable images etc.</p>



<p></p>



<h2 class="wp-block-heading" id="aioseo-use-only-one-h1-per-page-or-post">Use only one H1 per Page or Post</h2>



<p></p>



<p>It is recommended to use only <strong><em>one H1</em></strong> <em><strong>per Page or Post </strong></em>as per <strong><em>W3C </em></strong>specification.</p>



<p>H1 Tags describe the Header of your page or post and it is used extensively by a search engine. Put the most important content in your H1 Tag.</p>



<p></p>



<h2 class="wp-block-heading" id="aioseo-structure-your-html">Structure your HTML </h2>



<p></p>



<p>Use new HTML5 semantics like<em><strong> Header, Articles, Section, or Footer</strong></em> for more readability.</p>



<p></p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; highlight: [2,3,4,5,6,10,11,12,13,16,17,18,19]; title: ; notranslate">
&lt;body&gt;
    &lt;header&gt;
        ...
        ...

    &lt;/header&gt;
    &lt;article&gt;
        ...
        ...
        &lt;section&gt;
            ...
             ...
        &lt;/section&gt;
        ...
    &lt;/article&gt;
    &lt;footer&gt;
        ...
        ...
    &lt;/footer&gt;
&lt;/body&gt;   
</pre></div>


<p></p>



<h2 class="wp-block-heading" id="aioseo-design-html-for-fallback-mechanism">Design HTML for Fallback mechanism </h2>



<p></p>



<p>Always design for fallback. <strong><em>Static </em></strong>resources sometimes could be available like <strong><em>Images </em></strong>or <em><strong>Videos </strong></em>or <em><strong>Audio </strong></em>due to many other issues.</p>



<p></p>



<h2 class="wp-block-heading" id="aioseo-design-your-html-stateless">Design your HTML Stateless</h2>



<p></p>



<p>HTML defines the content and CSS defines the Design of your webpage. Javascript lets you define Interactivity and most important for dynamic web design.</p>



<p></p>



<p></p>



<p>Your web pages should be self-content using the above bare minimum technology. Define your objects without relying on state or embedded scripts or state value or cookies etc.</p>



<p></p>



<p><strong><em>References: </em></strong></p>



<p></p>



<ul class="has-medium-font-size wp-block-list"><li><em><a href="https://www.thecodebuzz.com/javascript-development-best-practices/" target="_blank" rel="noreferrer noopener" title="Javascript Development – Best Practices">Javascript Development – Best Practices</a></em></li></ul>



<p></p>



<p></p>



<p style="font-size:18px">Do you have any <strong>comments or ideas or any better </strong>suggestions to share?</p>



<p class="has-small-font-size"></p>



<p style="font-size:18px">Please sound off your comments below.</p>



<p class="has-medium-font-size"></p>



<p class="has-medium-font-size"><strong>Happy Coding </strong>!!</p>



<p></p>



<hr>



<p class=""></p>



<p class="has-background" style="background-color:#b6d9ac;font-size:18px"><br>Please <strong><em>bookmark </em></strong>this page and <em><strong>share </strong></em>it with your friends.                                                    Please <a href="https://www.thecodebuzz.com/subscription/" target="_blank" rel="noreferrer noopener"><em><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-luminous-vivid-orange-color"><strong>Subscribe</strong> </mark></em></a>to the blog to receive notifications on freshly published (2025) best practices and guidelines for software design and development.</p>




<br>



<hr>



<p class=""></p>



<p></p><p>The post <a href="https://thecodebuzz.com/html5-naming-and-style-convention-best-practices/">HTML5 Best Practices-Naming Style Convention</a> first appeared on <a href="https://thecodebuzz.com">TheCodeBuzz</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://thecodebuzz.com/html5-naming-and-style-convention-best-practices/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
