

{"id":79036,"date":"2020-07-07T09:00:07","date_gmt":"2020-07-07T03:30:07","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=79036"},"modified":"2024-07-24T16:49:04","modified_gmt":"2024-07-24T11:19:04","slug":"html-semantics","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/html-semantics\/","title":{"rendered":"HTML Semantic Elements and Semantic Tags"},"content":{"rendered":"<p>HTML tags are of two types &#8211; semantic tags and non-semantic tags. Typically, semantic refers to the meaning of a particular piece of code. In HTML5, a semantic tag defines the meaning of the code to the developer, user and the browser. Semantic tags clearly define the content surrounded by them, unlike the non-semantic tags.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-Semantic-Elements-df.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-79040\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-Semantic-Elements-df.jpg\" alt=\"HTML Semantic Elements\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-Semantic-Elements-df.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-Semantic-Elements-df-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-Semantic-Elements-df-1024x536.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-Semantic-Elements-df-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-Semantic-Elements-df-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-Semantic-Elements-df-520x272.jpg 520w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<h2>Advantages of HTML Semantic Elements<\/h2>\n<p><strong>1. Readability-<\/strong> The block of code becomes easier to read by the use of semantic elements. The semantic elements easily group similar elements together.<br \/>\n<strong>2. Accessibility-<\/strong> Semantic elements provide greater accessibility to assistive technologies like screen-readers and also to developers.<br \/>\n<strong>3. Consistent coding-<\/strong> With the use of semantic elements, one can easily get hold of consistent coding since the overall view of the web-page is defined by these elements.<br \/>\n<strong>4. Reusability-<\/strong> An HTML document created using semantic elements can be easily shared and reused across various developers and enterprises.<\/p>\n<p>In addition to these benefits, semantic elements also improve SEO (Search Engine Optimization). Most search engines support the use of descriptive tags and can interpret the structure of your web pages along with the content in them hence improving on the web page ranking. This can bring more people to your site and thus increase the chances of finding and sharing your content. Also, semantic elements assist in keeping a better layout or structure of the webpage in its development, thus proving essential when other developers continue on the work.<\/p>\n<h2>HTML Semantic Tags<\/h2>\n<p>Below are the semantic tags in HTML which we often use:<\/p>\n<h3>1. &lt;section&gt;<\/h3>\n<p>This element defines a section within an HTML document. It groups similar content together with a heading.<br \/>\n<strong>Syntax-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;section&gt;&lt;\/section&gt;\r\n<\/pre>\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;section&gt;\r\n&lt;h1&gt;DataFlair&lt;\/h1&gt;\r\n&lt;p&gt;Walking with the crowd is good. But performing outstanding in the crowd is what makes you different. This is what DataFlair aims to make its students.\r\nWe continuously work hard to bring you the best trainers to enable your smooth learning at your home as per your convenience. This is the reason why most of the DataFlair students get placed in top MNCs in Big Data just after the training.&lt;\/p&gt;\r\n&lt;\/section&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\/Image-1-section.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-79041\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-1-section.png\" alt=\"html section element\" width=\"1002\" height=\"216\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-1-section.png 1002w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-1-section-300x65.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-1-section-150x32.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-1-section-768x166.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-1-section-520x112.png 520w\" sizes=\"auto, (max-width: 1002px) 100vw, 1002px\" \/><\/a><\/p>\n<h3>2. &lt;article&gt;<\/h3>\n<p>We can specify independent and self-contained content using the &lt;article&gt; element. An article is distributed solely as opposed to the rest of the website and has its unique significance. It can be used for creating forums, blogs, and newspaper editorials.<br \/>\n<strong>Syntax-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;article&gt;&lt;\/article&gt;\r\n<\/pre>\n<p><strong>For Example<\/strong><\/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;h1&gt;Welcome to DataFlair!&lt;\/h1&gt;\r\n&lt;article&gt;\r\n  &lt;h2&gt;About Us&lt;\/h2&gt;\r\n  &lt;p&gt;We continuously work hard to bring you the best trainers to enable your smooth learning at your home as per your convenience. This is the reason why most of the DataFlair students get placed in top MNCs in Big Data just after the training.&lt;\/p&gt;\r\n&lt;\/article&gt;\r\n&lt;article&gt;\r\n  &lt;h2&gt;Vision&lt;\/h2&gt;\r\n  &lt;p&gt;To provide the best training in latest cutting edge technologies across the globe and help learners carve their career.&lt;\/p&gt;\r\n&lt;\/article&gt;\r\n&lt;article&gt;\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. &lt;\/p&gt;\r\n&lt;\/article&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\/Image-2article.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-79042\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-2article.png\" alt=\"html article head\" width=\"1063\" height=\"527\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-2article.png 1063w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-2article-300x149.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-2article-1024x508.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-2article-150x74.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-2article-768x381.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-2article-520x258.png 520w\" sizes=\"auto, (max-width: 1063px) 100vw, 1063px\" \/><\/a><\/p>\n<h2>Use of CSS<\/h2>\n<p>We can use CSS styling to explicitly style the article element.<\/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;style&gt;\r\n.DataFlair {\r\n  margin: 0;\r\n  padding: 5px;\r\n  background-color:  #ffcccc;\r\n}\r\n\r\n.DataFlair &gt; h1, .df {\r\n  margin: 10px;\r\n  padding: 5px;\r\n}\r\n\r\n.df {\r\n  background: white;\r\n}\r\n\r\n.df &gt; h2, p {\r\n  margin: 4px;\r\n  font-size: 90%;\r\n}\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;article class=\"DataFlair\"&gt;\r\n&lt;h1&gt;Welcome to DataFlair!&lt;\/h1&gt;\r\n&lt;article class=\"df\"&gt;\r\n  &lt;h2&gt;About Us&lt;\/h2&gt;\r\n  &lt;p&gt;We continuously work hard to bring you the best trainers to enable your smooth learning at your home as per your convenience. This is the reason why most of the DataFlair students get placed in top MNCs in Big Data just after the training.&lt;\/p&gt;\r\n&lt;\/article&gt;\r\n&lt;article class=\"df\"&gt;\r\n  &lt;h2&gt;Vision&lt;\/h2&gt;\r\n  &lt;p&gt;To provide the best training in latest cutting edge technologies across the globe and help learners carve their career.&lt;\/p&gt;\r\n&lt;\/article&gt;\r\n&lt;article class=\"df\"&gt;\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. &lt;\/p&gt;\r\n&lt;\/article&gt;\r\n&lt;\/article&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\/Image-3-css-for-article.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-79043\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-3-css-for-article.png\" alt=\"CSS for article\" width=\"1061\" height=\"435\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-3-css-for-article.png 1061w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-3-css-for-article-300x123.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-3-css-for-article-1024x420.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-3-css-for-article-150x61.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-3-css-for-article-768x315.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-3-css-for-article-520x213.png 520w\" sizes=\"auto, (max-width: 1061px) 100vw, 1061px\" \/><\/a><\/p>\n<h2>Nesting of &lt;article&gt; and &lt;section&gt; Elements in HTML<\/h2>\n<p>It is possible to nest section elements in article elements and vice-versa. As per the definition, article elements are self-contained, and section elements define a particular section, but this does not affect their nesting in an HTML document.<\/p>\n<h3>1. HTML &lt;header&gt; element<\/h3>\n<p>We can display the introductory content or navigational links as a container, using the &lt;header&gt; element. It contains the logo of a particular brand or website, the title or heading of the web-page, and information related to the ownership of the website.<br \/>\nA single HTML document can have multiple &lt;header&gt; elements but we cannot place a &lt;header&gt; element in a &lt;footer&gt; or &lt;address&gt; element.<br \/>\n<strong>Syntax-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;header&gt;&lt;\/header&gt;<\/pre>\n<p><strong>For Example<\/strong><\/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;\/head&gt;\r\n&lt;body&gt;\r\n&lt;article class=\"DataFlair\"&gt;\r\n&lt;header&gt;\r\n&lt;h1&gt;Welcome to DataFlair!&lt;\/h1&gt;\r\n&lt;\/header&gt;\r\n&lt;article class=\"df\"&gt;\r\n  &lt;h2&gt;About Us&lt;\/h2&gt;\r\n  &lt;p&gt;We continuously work hard to bring you the best trainers to enable your smooth learning at your home as per your convenience. This is the reason why most of the DataFlair students get placed in top MNCs in Big Data just after the training.&lt;\/p&gt;\r\n&lt;\/article&gt;\r\n&lt;\/article&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\/Image-4header-element.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-79044\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-4header-element.png\" alt=\"html header element\" width=\"1029\" height=\"220\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-4header-element.png 1029w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-4header-element-300x64.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-4header-element-1024x219.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-4header-element-150x32.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-4header-element-768x164.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-4header-element-520x111.png 520w\" sizes=\"auto, (max-width: 1029px) 100vw, 1029px\" \/><\/a><\/p>\n<h3>2. HTML &lt;footer&gt; element<\/h3>\n<p>The footer of an HTML document is defined by the &lt;footer&gt; element. It contains information such as copyright, contact, related documents, sitemap, etc.<br \/>\nAn HTML document can have multiple footer elements.<br \/>\n<strong>Syntax-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;footer&gt;&lt;\/footer&gt;\r\n<\/pre>\n<p><strong>For Example<\/strong><\/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;footer&gt;\r\n  &lt;p&gt;Posted by DataFlair&lt;\/p&gt;\r\n  &lt;p&gt;Contact information: &lt;a href=\"mailto:abc@example.com\"&gt;\r\n  https:\/\/data-flair.training\/&lt;\/a&gt;.&lt;\/p&gt;\r\n&lt;\/footer&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\/Image-5footer-element.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-79045\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-5footer-element.png\" alt=\"html footer element\" width=\"405\" height=\"116\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-5footer-element.png 405w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-5footer-element-300x86.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-5footer-element-150x43.png 150w\" sizes=\"auto, (max-width: 405px) 100vw, 405px\" \/><\/a><\/p>\n<h3>3. HTML &lt;nav&gt; element<\/h3>\n<p>The &lt;nav&gt; element contains the set of major links related to an HTML document. It is not necessary for all the links to be a part of the &lt;nav&gt; elements.<br \/>\n<strong>Syntax-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;nav&gt;&lt;\/nav&gt;\r\n<\/pre>\n<p><strong>For Example<\/strong><\/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;nav&gt;\r\n  &lt;a href=\"#\"&gt;HTML&lt;\/a&gt; |\r\n  &lt;a href=\"#\"&gt;CSS&lt;\/a&gt; |\r\n  &lt;a href=\"#\"&gt;PhP&lt;\/a&gt; |\r\n  &lt;a href=\"#\"&gt;XML&lt;\/a&gt;\r\n&lt;\/nav&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\/Image-6nav-element.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-79046\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-6nav-element.png\" alt=\"html nav element\" width=\"226\" height=\"54\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-6nav-element.png 226w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-6nav-element-150x36.png 150w\" sizes=\"auto, (max-width: 226px) 100vw, 226px\" \/><\/a><\/p>\n<h3>4. HTML &lt;aside&gt; element<\/h3>\n<p>The &lt;aside&gt; element contains information that may not be directly related to the web-content but is relevant to the overall website.<br \/>\nIt can also be styled using CSS.<br \/>\n<strong>Syntax-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;aside&gt;&lt;\/aside&gt;\r\n<\/pre>\n<p><strong>For Example<\/strong><\/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;style&gt;\r\naside {\r\n  width: 30%;\r\n  padding-left: 15px;\r\n  margin-left: 15px;\r\n  float: right;\r\n  font-style: italic;\r\n  background-color: #ffcccc;\r\n}\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;p&gt;I visited the Central Park this morning. The weather was nice, and it was amazing. I had a great time with my family!&lt;\/p&gt;\r\n&lt;aside&gt;\r\n&lt;p&gt;The Central Park is a theme park at Walt Disney World Resort featuring exciting attractions, international pavilions, award-winning fireworks and seasonal special events.&lt;\/p&gt;\r\n&lt;\/aside&gt;\r\n&lt;p&gt;I visited the Central Park this morning. The weather was nice, and it was amazing. I had a great time with my family!&lt;\/p&gt;\r\n&lt;p&gt;I visited the Central Park this morning. The weather was nice, and it was amazing. I had a great time with my family!&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\/Image-7aside-element.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-79047 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-7aside-element.png\" alt=\"html aside element in html semantic elements\" width=\"1065\" height=\"242\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-7aside-element.png 1065w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-7aside-element-300x68.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-7aside-element-1024x233.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-7aside-element-150x34.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-7aside-element-768x175.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-7aside-element-520x118.png 520w\" sizes=\"auto, (max-width: 1065px) 100vw, 1065px\" \/><\/a><\/p>\n<h3>5. HTML &lt;figure&gt; and &lt;figcaption&gt; elements<\/h3>\n<p>The &lt;figure&gt; caption is a self-contained element that contains illustrations, images, diagrams, etc. The caption for the element in the &lt;figure&gt; element is given by &lt;figcaption&gt;.<br \/>\nThe &lt;figcaption&gt; element can be the first or last child of the &lt;figure&gt; element depending on the display preference.<br \/>\n<strong>Syntax-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;figure&gt;&lt;figcaption&gt;&lt;\/figcaption&lt;\/figure&gt;\r\n<\/pre>\n<p><strong>For Example<\/strong><\/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;h2&gt;Scenery&lt;\/h2&gt;\r\n&lt;p&gt;Here is a landscape&lt;\/p&gt;\r\n&lt;figure&gt;\r\n  &lt;img src=\"images\/landscape.jpg\" alt=\"landscape\" style=\"width:75%\"&gt;\r\n  &lt;figcaption&gt;Fig.1.&lt;\/figcaption&gt;\r\n&lt;\/figure&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\/Image-8fig-and-figcaption.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-79048\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-8fig-and-figcaption.png\" alt=\"html fig and figcaption\" width=\"833\" height=\"567\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-8fig-and-figcaption.png 833w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-8fig-and-figcaption-300x204.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-8fig-and-figcaption-150x102.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-8fig-and-figcaption-768x523.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-8fig-and-figcaption-520x354.png 520w\" sizes=\"auto, (max-width: 833px) 100vw, 833px\" \/><\/a><\/p>\n<p>The other semantic elements that have been discussed before are &lt;main&gt;, &lt;details&gt;, &lt;mark&gt;, &lt;summary&gt; and &lt;time&gt;.<\/p>\n<p>Examples of non-semantic elements are &lt;div&gt; and &lt;span&gt;. We can also use syntax such as &lt;div id= \u201cheader\u201d&gt;, &lt;div id= \u201cnav\u201d&gt;, &lt;div id= \u201cfooter\u201d&gt; to create such elements.<\/p>\n<h2>Summary<\/h2>\n<p>In this article, we\u2019ve looked at the HTML semantic elements. Semantic elements provide a better meaning or semantic to the web-page. These elements also provide better readability, reusability, accessibility, and consistent coding. The elements that have been discussed are &lt;section&gt;,&lt;article&gt;, &lt;header&gt;, &lt;footer&gt;, &lt;aside&gt;, &lt;figure&gt; and &lt;figcaption&gt;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>HTML tags are of two types &#8211; semantic tags and non-semantic tags. Typically, semantic refers to the meaning of a particular piece of code. In HTML5, a semantic tag defines the meaning of the&#46;&#46;&#46;<\/p>\n","protected":false},"author":10,"featured_media":79040,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22400],"tags":[22528,22529,22527],"class_list":["post-79036","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html","tag-html-semantic-elements","tag-html-semantic-tags","tag-html-semantics"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>HTML Semantic Elements and Semantic Tags - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn what are HTML Semantic Elements and Semantic Tags and their advantages. Learn tags like Header, footer, article, section, aside, figure and figcaption\" \/>\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-semantics\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HTML Semantic Elements and Semantic Tags - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn what are HTML Semantic Elements and Semantic Tags and their advantages. Learn tags like Header, footer, article, section, aside, figure and figcaption\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/html-semantics\/\" \/>\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-07T03:30:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-24T11:19:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-Semantic-Elements-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=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HTML Semantic Elements and Semantic Tags - DataFlair","description":"Learn what are HTML Semantic Elements and Semantic Tags and their advantages. Learn tags like Header, footer, article, section, aside, figure and figcaption","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-semantics\/","og_locale":"en_US","og_type":"article","og_title":"HTML Semantic Elements and Semantic Tags - DataFlair","og_description":"Learn what are HTML Semantic Elements and Semantic Tags and their advantages. Learn tags like Header, footer, article, section, aside, figure and figcaption","og_url":"https:\/\/data-flair.training\/blogs\/html-semantics\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2020-07-07T03:30:07+00:00","article_modified_time":"2024-07-24T11:19:04+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-Semantic-Elements-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":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/html-semantics\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/html-semantics\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/a90b082e16aa38d207212d22b0581f33"},"headline":"HTML Semantic Elements and Semantic Tags","datePublished":"2020-07-07T03:30:07+00:00","dateModified":"2024-07-24T11:19:04+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/html-semantics\/"},"wordCount":794,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/html-semantics\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-Semantic-Elements-df.jpg","keywords":["html semantic elements","html Semantic Tags","html semantics"],"articleSection":["HTML Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/html-semantics\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/html-semantics\/","url":"https:\/\/data-flair.training\/blogs\/html-semantics\/","name":"HTML Semantic Elements and Semantic Tags - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/html-semantics\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/html-semantics\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-Semantic-Elements-df.jpg","datePublished":"2020-07-07T03:30:07+00:00","dateModified":"2024-07-24T11:19:04+00:00","description":"Learn what are HTML Semantic Elements and Semantic Tags and their advantages. Learn tags like Header, footer, article, section, aside, figure and figcaption","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/html-semantics\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/html-semantics\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/html-semantics\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-Semantic-Elements-df.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/HTML-Semantic-Elements-df.jpg","width":1200,"height":628,"caption":"HTML Semantic Elements"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/html-semantics\/#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 Semantic Elements and Semantic Tags"}]},{"@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\/79036","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=79036"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/79036\/revisions"}],"predecessor-version":[{"id":142890,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/79036\/revisions\/142890"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/79040"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=79036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=79036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=79036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}