

{"id":79109,"date":"2020-07-09T09:00:36","date_gmt":"2020-07-09T03:30:36","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=79109"},"modified":"2024-07-24T16:43:55","modified_gmt":"2024-07-24T11:13:55","slug":"html-style-guide","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/html-style-guide\/","title":{"rendered":"HTML Style Guide &#8211; HTML Coding Conventions"},"content":{"rendered":"<p>While developing a website, it is important to maintain a set of rules and abide by them. As developers, it is our duty to make the code visually appealing and understandable to other developers and users. There are some basic norms that we need to follow to attain this consistency in website development. Let us learn more about HTML Style Guide that you must follow.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-style-guide-df.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-79118\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-style-guide-df.jpg\" alt=\"HTML style guide\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-style-guide-df.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-style-guide-df-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-style-guide-df-1024x536.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-style-guide-df-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-style-guide-df-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-style-guide-df-520x272.jpg 520w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<h2>HTML Style Guide<\/h2>\n<p>Understanding appropriate HTML coding practices are essential when developing web accessible, and easily modifiable websites. Thus, following these standards developers make sure that others will be able to easily comprehend their code. This becomes particularly crucial when working in teams or passing a project on to another developer. Comprehensible and unambiguous code is useful in troubleshooting and positively impacts the software development process.<\/p>\n<p>Moreover, following HTML conventions improves the performance and compatibility of web pages across different browsers and devices. These are important because it makes it easier for browsers to read the content and therefore enhances the user experience. Following these best practices also helps when it comes to search engine optimization since the source code is much cleaner. This can significantly impact the visibility and ranking of web pages in search engine results.<\/p>\n<p>Let us learn HTML Coding Standards best practices now:<\/p>\n<h3>1. Declaration of document type in HTML<\/h3>\n<p>It is essential to mention the type of document that should be displayed by the browser. This allows the browser to know what type of document it should render and thus use its resources.<br \/>\nThe correct document type for HTML5 is-<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE Html&gt;\r\n<\/pre>\n<p>Not mentioning the document type is considered as a bad practice.<\/p>\n<h3>2. Use of lowercase element names in HTML<\/h3>\n<p>However, HTML allows the use of lowercase or uppercase element names; we recommend you to opt for lowercase names as it looks clean and is easier to write.<br \/>\n<strong>Correct-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;body&gt;\r\n  &lt;p&gt;Welcome to DataFlair&lt;\/p&gt;\r\n&lt;\/body&gt;\r\n<\/pre>\n<p><strong>Incorrect-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;BODY&gt;\r\n  &lt;P&gt;Welcome to DataFlair!&lt;\/P&gt;\r\n&lt;\/BODY&gt;\r\n<\/pre>\n<h3>3. Close all elements in HTML<\/h3>\n<p>HTML does not impose on closing all the elements, but it is better to do so.<br \/>\n<strong>Correct-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;body&gt;\r\n  &lt;p&gt;Welcome to DataFlair.&lt;\/p&gt;\r\n&lt;\/body&gt;\r\n<\/pre>\n<p><strong>Incorrect-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;body&gt;\r\n  &lt;p&gt;Welcome to DataFlair.\r\n&lt;\/body&gt;\r\n<\/pre>\n<h3>4. Use Lowercase Attribute Names in HTML<\/h3>\n<p>Like elements, there is no clear distinction provided by HTML in using upper or lower case names for attributes. However, it is good practice to use lowercase letters for attribute names.<br \/>\n<strong>Correct-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;a href=\"https:\/\/data-flair.training\/\"&gt;Welcome to DataFlair&lt;\/a&gt;\r\n<\/pre>\n<p><strong>Incorrect-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;a HREF=\"https:\/\/data-flair.training\/\"&gt;Welcome to DataFlair&lt;\/a&gt;<\/pre>\n<h3>5. Quote Attribute Values in HTML<\/h3>\n<p>Developers usually don\u2019t quote the attribute values, but it is a better approach to do so since it improves the readability of the code. One must also ensure not to use spaces.<br \/>\n<strong>Correct-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;table class= \u201cbordered\u201d&gt;\r\n<\/pre>\n<p><strong>Incorrect-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;table class= bordered&gt;\r\n<\/pre>\n<p><strong>Does not work-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;table class= table striped&gt;\r\n<\/pre>\n<p>This does not work because of the spaces.<\/p>\n<h3>6. Specification of alt, width and height attributes of the image in HTML<\/h3>\n<p>It is an excellent practice to always specify the \u2018alt\u2019 attribute since it is the alternative text that appears if the browser is unable to display the image.<br \/>\nSimilarly, the height and width attributes reserve the space for an image before loading and thus prevent flickering.<br \/>\n<strong>Correct-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;img src=\"tree.jpg\" alt=\"Tree\" height=\"500px\" width=\"500px\"&gt;\r\n<\/pre>\n<p><strong>Incorrect-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;img src=\"tree.jpg\"&gt;\r\n<\/pre>\n<h3>7. Spaces between equal signs in HTML<\/h3>\n<p>Though it is allowed to use spaces within equal signs, it is highly recommended not to do so since it disrupts the readability of the code.<br \/>\n<strong>Correct-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;a href=\"https:\/\/data-flair.training\/\"&gt;Welcome to DataFlair&lt;\/a&gt;\r\n<\/pre>\n<p><strong>Incorrect-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;a href = \"https:\/\/data-flair.training\/\"&gt;Welcome to DataFlair&lt;\/a&gt;\r\n<\/pre>\n<h3>8. HTML Long Code Lines<\/h3>\n<p>It is advisable not to use too long lines of code and break them instead. This prevents unnecessary scrolling from left to right.<\/p>\n<h3>9. HTML Indentation and Blank lines<\/h3>\n<p>It is not recommended to use blank lines and indentation unnecessarily in an HTML document. It is a better approach to add blank lines to separate blocks of code, and indentation should be limited to two spaces rather than the tab key.<br \/>\n<strong>Correct-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;body&gt;\r\n\r\n&lt;h1&gt;DataFlair&lt;\/h1&gt;\r\n\r\n&lt;h2&gt;Mission&lt;\/h2&gt;\r\n&lt;p&gt;To provide quality education at an affordable price to help everyone develop their career in the latest technologies. We aim to reach the mass through our unique pedagogy model for Self-paced learning and Instructor-led learning that includes personalized guidance, lifetime course access, 24\u00d77 support, live project, resume and interview preparation and ready to work level learning. We aim to provide real-time technical experience to learners through our expert instructors. &lt;\/p&gt;\r\n\r\n&lt;\/body&gt;\r\n<\/pre>\n<p><strong>Incorrect-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;body&gt;\r\n\r\n&lt;h1&gt;DataFlair&lt;\/h1&gt;\r\n\r\n&lt;h2&gt;Mission&lt;\/h2&gt;\r\n\r\n&lt;p&gt;To provide quality education at an affordable price to help everyone develop their career in the latest technologies. We aim to reach the mass through our unique pedagogy model for Self-paced learning and Instructor-led learning that includes personalized guidance, lifetime course access, 24\u00d77 support, live project, resume and interview preparation and ready to work level learning. We aim to provide real-time technical experience to learners through our expert instructors. &lt;\/p&gt;\r\n\r\n&lt;\/body&gt;\r\n<\/pre>\n<p><strong>For example-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;table&gt;\r\n  &lt;tr&gt;\r\n    &lt;th&gt;Name&lt;\/th&gt;\r\n    &lt;th&gt;Information&lt;\/th&gt;\r\n  &lt;\/tr&gt;\r\n  &lt;tr&gt;\r\n    &lt;td&gt;Name1&lt;\/td&gt;\r\n    &lt;td&gt;Information&lt;\/td&gt;\r\n  &lt;\/tr&gt;\r\n  &lt;tr&gt;\r\n    &lt;td&gt;Name2&lt;\/td&gt;\r\n    &lt;td&gt;Information&lt;\/td&gt;\r\n  &lt;\/tr&gt;\r\n&lt;\/table&gt;\r\n<\/pre>\n<p><strong>For example-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;ul&gt;\r\n  &lt;li&gt;Fruits&lt;\/li&gt;\r\n  &lt;li&gt;Vegetables&lt;\/li&gt;\r\n  &lt;li&gt;Groceries&lt;\/li&gt;\r\n&lt;\/ul&gt;\r\n<\/pre>\n<h3>10. HTML &lt;title&gt; element<\/h3>\n<p>One should always use the &lt;title&gt; element in an HTML document since it plays a significant role in search engine optimization(SEO). Here, the name of a web-page is used by the search engine algorithms to decide its order, when it lists related searched query pages as per the search results.<br \/>\nWe should name the web-page accurately, and it should have a meaningful name.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;title&gt;Name of the web-page&lt;\/title&gt;.<\/pre>\n<h3>11. HTML Omission of &lt;html&gt; and &lt;body&gt; tags<\/h3>\n<p>The HTML web-page will be rendered successfully even if we omit the &lt;html&gt; and the &lt;body&gt; elements. However, it is a better approach to use them as omitting the &lt;body&gt; tag produces errors in the old browsers, and omitting the &lt;head&gt; tag can crash the XML and DOM softwares.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;head&gt;\r\n  &lt;title&gt;Page Title&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n\r\n&lt;h1&gt;Hi&lt;\/h1&gt;\r\n&lt;p&gt;Welcome&lt;\/p&gt;\r\n<\/pre>\n<h3>12. HTML Omission of &lt;head&gt;<\/h3>\n<p>The &lt;head&gt; tag can also be omitted in HTML. All the elements defined before the &lt;body&gt; tag are automatically added to the default &lt;head&gt; by the browser.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;title&gt;Title&lt;\/title&gt;\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Hi&lt;\/h1&gt;\r\n&lt;p&gt;Welcome&lt;\/p&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<h3>13. HTML Close empty tags<\/h3>\n<p>It is optional to close the empty tags in HTML. However, while using XML or XHTML,the closing slash (\/) is necessary.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;meta charset= \u201cutf-8\u201d \/&gt;<\/pre>\n<h3>14. HTML Lang attribute<\/h3>\n<p>We should always specify the lang attribute to define the language of the web-page to the browsers and the search engines.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en-US\"&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Title&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Hi&lt;\/h1&gt;\r\n&lt;p&gt;Welcome&lt;\/p&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<h3>15. HTML Meta Data<\/h3>\n<p>The &lt;meta&gt; tag contains additional information related to the document such as page description, keywords, author, character set, etc. The web browsers use the metadata to display content, and keywords are used by search engines and other web-services.<\/p>\n<p><strong>Character Set-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;meta charset=\"UTF-8\"&gt;<\/pre>\n<p>It is a good practice to define the meta charset at the earliest in an HTML document.<\/p>\n<h3>16. Setting viewport in HTML<\/h3>\n<p>We use the &lt;meta&gt; tag of the head to create a viewport for a website.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h2&gt;Viewport&lt;\/h2&gt;\r\n&lt;p&gt;Try to run this code on different websites.&lt;\/p&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image1setting-viewport.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-79119\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image1setting-viewport.png\" alt=\"html setting viewport\" width=\"347\" height=\"166\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image1setting-viewport.png 347w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image1setting-viewport-300x144.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image1setting-viewport-150x72.png 150w\" sizes=\"auto, (max-width: 347px) 100vw, 347px\" \/><\/a><\/p>\n<p>The browser controls the scaling of the web-page, using the meta viewport. The width=device-width specifies that page\u2019s width will be equal to the device\u2019s width where the web page will be displayed.<\/p>\n<p>The initial-scale=1.0 is used to set the initial zoom level of the web-page when it is first loaded.<\/p>\n<h3>17. HTML Comments<\/h3>\n<p>It is advisable to use short comments like-<br \/>\n&lt;!&#8211;following is a paragraph\u2192<br \/>\nLong comments like-<br \/>\n&lt;!&#8211;<br \/>\nThis is a long comment example.<br \/>\nThis is a long comment example.<br \/>\n&#8211;&gt;<\/p>\n<p>Long comments become easily observable when indented with two spaces.<\/p>\n<h3>18. HTML Style Sheets<\/h3>\n<p>For linking stylesheets,we can use simple linking syntax. The type attribute is not necessary.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;link rel=\"stylesheet\" href=\"DataFlair.css\"&gt;<\/pre>\n<p>We should compress short CSS rules in a single line.<\/p>\n<p>p{font-family:Verdana; font-size:15px}<\/p>\n<p>We should write long CSS rules over multiple lines.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">body {\r\n  background-color: black;\r\n  font-family: \"Arial Black\";\r\n  font-size: 16em;\r\n  color: white;\r\n}\r\n<\/pre>\n<p><strong>Note-<\/strong><\/p>\n<ul>\n<li>Use a space before the opening bracket.<\/li>\n<li>Use two spaces for indentation.<\/li>\n<li>Only Use quotes for the values if they contain spaces.<\/li>\n<li>Use a semicolon for each property-value pair.<\/li>\n<li>Place the closing bracket on the last line.<\/li>\n<\/ul>\n<h3>19. JavaScript<\/h3>\n<p>The type attribute is not necessary for linking the javascript files. Use the simple syntax.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;script src=\"DataFlair.js\"&gt;<\/pre>\n<p><strong>Accessing HTML Elements<\/strong><br \/>\nThere should be a correct use of id attributes to access HTML elements else it would produce errors.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;body&gt;\r\n&lt;p id=\"Demo\"&gt;Paragraph 1.&lt;\/p&gt;\r\n&lt;p id=\"demo\"&gt;Paragraph 2.&lt;\/p&gt;\r\n&lt;script&gt;\r\n\/\/ Paragraph 2 will be overwritten\r\ndocument.getElementById(\"demo\").innerHTML = \"HELLO!\";\r\n&lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>Output-<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image2JavaScript.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-79120\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image2JavaScript.png\" alt=\"html javascript\" width=\"161\" height=\"129\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image2JavaScript.png 161w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image2JavaScript-150x120.png 150w\" sizes=\"auto, (max-width: 161px) 100vw, 161px\" \/><\/a><\/p>\n<h3>20. HTML File names<\/h3>\n<p>Some web servers such as Apache and Unix do not allow case-insensitive file names to be loaded on their web-page. For example, delhi.jpg would not be the same as Delhi.jpg.<br \/>\nOne must be aware of the case-sensitivity of their servers and do the naming of files accordingly. Hence, it is advisable always to use lowercase name schemes.<\/p>\n<h3>21. HTML Extensions<\/h3>\n<p>The HTML document should have .html or .htm as the file extension. There is no difference between the two.<br \/>\nA CSS file should have .css extension, and a javascript file should have .js as the extension.<\/p>\n<h3>22. HTML Default Filenames<\/h3>\n<p>If the URL of a particular file does not specify its filename, a default filename such as index.html or default.html is added by the server itself.<br \/>\nWe can configure the server with multiple default filenames but ensure that the same name is not used for another file.<\/p>\n<h2>Summary<\/h2>\n<p>In this article, we\u2019ve looked at the intricacies of creating an HTML document, the best practices, and the correct usage of syntax. We\u2019ve discussed some major HTML Style Guide such as the declaration of the document type, use of lang attributes, closing tags, use of lowercase names for attributes and elements, quoting of values, etc. We\u2019ve also discussed the best practices involved with CSS and JavaScript, along with setting viewports.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While developing a website, it is important to maintain a set of rules and abide by them. As developers, it is our duty to make the code visually appealing and understandable to other developers&#46;&#46;&#46;<\/p>\n","protected":false},"author":10,"featured_media":79118,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22400],"tags":[22551,22552],"class_list":["post-79109","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html","tag-html-coding-conventions","tag-html-style-guide"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>HTML Style Guide - HTML Coding Conventions - DataFlair<\/title>\n<meta name=\"description\" content=\"HTML Style Guide - Learn abolut HTML Coding conventions and best practices to follow such as declaration of document type, use of lang attributes, closing tags, use of lowercase names for attributes and elements, quoting of values etc\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/html-style-guide\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HTML Style Guide - HTML Coding Conventions - DataFlair\" \/>\n<meta property=\"og:description\" content=\"HTML Style Guide - Learn abolut HTML Coding conventions and best practices to follow such as declaration of document type, use of lang attributes, closing tags, use of lowercase names for attributes and elements, quoting of values etc\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/html-style-guide\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-09T03:30:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-24T11:13:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-style-guide-df.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HTML Style Guide - HTML Coding Conventions - DataFlair","description":"HTML Style Guide - Learn abolut HTML Coding conventions and best practices to follow such as declaration of document type, use of lang attributes, closing tags, use of lowercase names for attributes and elements, quoting of values etc","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/html-style-guide\/","og_locale":"en_US","og_type":"article","og_title":"HTML Style Guide - HTML Coding Conventions - DataFlair","og_description":"HTML Style Guide - Learn abolut HTML Coding conventions and best practices to follow such as declaration of document type, use of lang attributes, closing tags, use of lowercase names for attributes and elements, quoting of values etc","og_url":"https:\/\/data-flair.training\/blogs\/html-style-guide\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2020-07-09T03:30:36+00:00","article_modified_time":"2024-07-24T11:13:55+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-style-guide-df.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/html-style-guide\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/html-style-guide\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/a90b082e16aa38d207212d22b0581f33"},"headline":"HTML Style Guide &#8211; HTML Coding Conventions","datePublished":"2020-07-09T03:30:36+00:00","dateModified":"2024-07-24T11:13:55+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/html-style-guide\/"},"wordCount":1353,"commentCount":1,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/html-style-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-style-guide-df.jpg","keywords":["HTML Coding Conventions","HTML style guide"],"articleSection":["HTML Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/html-style-guide\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/html-style-guide\/","url":"https:\/\/data-flair.training\/blogs\/html-style-guide\/","name":"HTML Style Guide - HTML Coding Conventions - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/html-style-guide\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/html-style-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-style-guide-df.jpg","datePublished":"2020-07-09T03:30:36+00:00","dateModified":"2024-07-24T11:13:55+00:00","description":"HTML Style Guide - Learn abolut HTML Coding conventions and best practices to follow such as declaration of document type, use of lang attributes, closing tags, use of lowercase names for attributes and elements, quoting of values etc","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/html-style-guide\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/html-style-guide\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/html-style-guide\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-style-guide-df.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-style-guide-df.jpg","width":1200,"height":628,"caption":"HTML style guide"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/html-style-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"HTML Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/html\/"},{"@type":"ListItem","position":3,"name":"HTML Style Guide &#8211; HTML Coding Conventions"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/a90b082e16aa38d207212d22b0581f33","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team is passionate about delivering top-notch tutorials and resources on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. With expertise in the tech industry, we simplify complex topics to help learners excel. Stay updated with our latest insights.","url":"https:\/\/data-flair.training\/blogs\/author\/dfadteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/79109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=79109"}],"version-history":[{"count":5,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/79109\/revisions"}],"predecessor-version":[{"id":142883,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/79109\/revisions\/142883"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/79118"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=79109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=79109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=79109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}