{"id":237,"date":"2025-07-24T03:12:12","date_gmt":"2025-07-24T03:12:12","guid":{"rendered":"https:\/\/mitalgoswami.in\/?p=237"},"modified":"2025-07-24T05:55:21","modified_gmt":"2025-07-24T05:55:21","slug":"html-5-syntax","status":"publish","type":"post","link":"https:\/\/mitalgoswami.in\/?p=237","title":{"rendered":"HTML 5 &amp; Syntax"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>HTML5 Document Structure Tags<\/strong><\/h2>\n\n\n\n<p>HTML5 introduced semantic elements to describe the structure of web documents more clearly:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>Tag<\/strong><\/th><th><strong>Purpose<\/strong><\/th><\/tr><\/thead><tbody><tr><td><code>&lt;section&gt;<\/code><\/td><td>Defines a standalone section in a document, typically with a heading.<\/td><\/tr><tr><td><code>&lt;article&gt;<\/code><\/td><td>Represents self-contained content (e.g., a blog post, article, or comment).<\/td><\/tr><tr><td><code>&lt;aside&gt;<\/code><\/td><td>Defines content that is tangentially related (e.g., a sidebar or ad).<\/td><\/tr><tr><td><code>&lt;header&gt;<\/code><\/td><td>Contains introductory content (logo, nav, heading) usually at the top of a section or page.<\/td><\/tr><tr><td><code>&lt;footer&gt;<\/code><\/td><td>Contains footer information (contact, copyright, links).<\/td><\/tr><tr><td><code>&lt;nav&gt;<\/code><\/td><td>Declares navigation links.<\/td><\/tr><tr><td><code>&lt;dialog&gt;<\/code><\/td><td>Represents a dialog box or popup window.<\/td><\/tr><tr><td><code>&lt;figure&gt;<\/code><\/td><td>Wraps self-contained media content (images, charts, etc.) with <code>&lt;figcaption&gt;<\/code>.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html>\n&lt;html lang=\"en\">\n&lt;head>\n  &lt;meta charset=\"UTF-8\">\n  &lt;title>HTML5 Structure Example&lt;\/title>\n&lt;\/head>\n&lt;body>\n\n  &lt;header>\n    &lt;h1>My Website&lt;\/h1>\n    &lt;nav>\n      &lt;a href=\"#home\">Home&lt;\/a> |\n      &lt;a href=\"#about\">About&lt;\/a> |\n      &lt;a href=\"#contact\">Contact&lt;\/a>\n    &lt;\/nav>\n  &lt;\/header>\n\n  &lt;section id=\"home\">\n    &lt;h2>Welcome Section&lt;\/h2>\n    &lt;p>This is the main welcome section of the page.&lt;\/p>\n  &lt;\/section>\n\n  &lt;section id=\"about\">\n    &lt;article>\n      &lt;h2>About Us&lt;\/h2>\n      &lt;p>This article talks about our history and mission.&lt;\/p>\n    &lt;\/article>\n    &lt;article>\n      &lt;h2>Team&lt;\/h2>\n      &lt;p>This article introduces our team members.&lt;\/p>\n    &lt;\/article>\n  &lt;\/section>\n\n  &lt;aside>\n    &lt;h3>Quick Links&lt;\/h3>\n    &lt;ul>\n      &lt;li>&lt;a href=\"#\">FAQ&lt;\/a>&lt;\/li>\n      &lt;li>&lt;a href=\"#\">Support&lt;\/a>&lt;\/li>\n    &lt;\/ul>\n  &lt;\/aside>\n\n  &lt;figure>\n    &lt;img src=\"image.jpg\" alt=\"Example Image\" width=\"300\">\n    &lt;figcaption>This is a caption for the image.&lt;\/figcaption>\n  &lt;\/figure>\n\n  &lt;dialog open>\n    &lt;p>This is a sample dialog box.&lt;\/p>\n  &lt;\/dialog>\n\n  &lt;footer>\n    &lt;p>&amp;copy; 2025 My Website. All rights reserved.&lt;\/p>\n  &lt;\/footer>\n\n&lt;\/body>\n&lt;\/html>\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>HTML5 Multimedia and Graphics<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Audio &amp; Video Tags<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">htmlCopyEdit<code>&lt;audio controls&gt;\n  &lt;source src=\"sound.mp3\" type=\"audio\/mpeg\"&gt;\n&lt;\/audio&gt;\n\n&lt;video controls width=\"400\"&gt;\n  &lt;source src=\"video.mp4\" type=\"video\/mp4\"&gt;\n&lt;\/video&gt;\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Attributes:<\/strong> <code>controls<\/code>, <code>autoplay<\/code>, <code>loop<\/code>, <code>muted<\/code>, <code>poster<\/code> (for <code>&lt;video><\/code>)<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><code>me-local<\/code><\/td><td>Select local date and time (no timezone).<\/td><\/tr><tr><td><code>date<\/code><\/td><td>Select a calendar date.<\/td><\/tr><tr><td><code>month<\/code><\/td><td>Select month and year only.<\/td><\/tr><tr><td><code>week<\/code><\/td><td>Select a week of the year.<\/td><\/tr><tr><td><code>time<\/code><\/td><td>Select time (hours &amp; minutes).<\/td><\/tr><tr><td><code>number<\/code><\/td><td>Input only numeric values.<\/td><\/tr><tr><td><code>range<\/code><\/td><td>Slider control to select a numeric value.<\/td><\/tr><tr><td><code>email<\/code><\/td><td>Validates email format.<\/td><\/tr><tr><td><code>url<\/code><\/td><td>Validates web address format.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 <strong>Example: HTML5 Web Form<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">htmlCopyEdit<code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n  &lt;meta charset=\"UTF-8\"&gt;\n  &lt;title&gt;HTML5 Input Types Example&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n\n  &lt;h2&gt;HTML5 Web Form Example&lt;\/h2&gt;\n  &lt;form&gt;\n    \n    &lt;label for=\"datetime\"&gt;Date &amp; Time:&lt;\/label&gt;\n    &lt;input type=\"datetime-local\" id=\"datetime\" name=\"datetime\"&gt;&lt;br&gt;&lt;br&gt;\n\n    &lt;label for=\"date\"&gt;Date:&lt;\/label&gt;\n    &lt;input type=\"date\" id=\"date\" name=\"date\"&gt;&lt;br&gt;&lt;br&gt;\n\n    &lt;label for=\"month\"&gt;Month:&lt;\/label&gt;\n    &lt;input type=\"month\" id=\"month\" name=\"month\"&gt;&lt;br&gt;&lt;br&gt;\n\n    &lt;label for=\"week\"&gt;Week:&lt;\/label&gt;\n    &lt;input type=\"week\" id=\"week\" name=\"week\"&gt;&lt;br&gt;&lt;br&gt;\n\n    &lt;label for=\"time\"&gt;Time:&lt;\/label&gt;\n    &lt;input type=\"time\" id=\"time\" name=\"time\"&gt;&lt;br&gt;&lt;br&gt;\n\n    &lt;label for=\"number\"&gt;Number (1-10):&lt;\/label&gt;\n    &lt;input type=\"number\" id=\"number\" name=\"number\" min=\"1\" max=\"10\"&gt;&lt;br&gt;&lt;br&gt;\n\n    &lt;label for=\"range\"&gt;Volume (0\u2013100):&lt;\/label&gt;\n    &lt;input type=\"range\" id=\"range\" name=\"volume\" min=\"0\" max=\"100\"&gt;&lt;br&gt;&lt;br&gt;\n\n    &lt;label for=\"email\"&gt;Email:&lt;\/label&gt;\n    &lt;input type=\"email\" id=\"email\" name=\"email\" required&gt;&lt;br&gt;&lt;br&gt;\n\n    &lt;label for=\"url\"&gt;Website:&lt;\/label&gt;\n    &lt;input type=\"url\" id=\"url\" name=\"url\"&gt;&lt;br&gt;&lt;br&gt;\n\n    &lt;input type=\"submit\" value=\"Submit\"&gt;\n\n  &lt;\/form&gt;\n\n&lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>HTML5 Document Structure Tags HTML5 introduced semantic elements to describe the structure of web documents more clearly: Tag Purpose &lt;section&gt; Defines a standalone section in a document, typically with a heading. &lt;article&gt; Represents self-contained content (e.g., a blog post, article, or comment). &lt;aside&gt; Defines content that is tangentially related (e.g., a sidebar or ad). &lt;header&gt; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-237","post","type-post","status-publish","format-standard","hentry","category-internet-networking"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=\/wp\/v2\/posts\/237","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=237"}],"version-history":[{"count":1,"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=\/wp\/v2\/posts\/237\/revisions"}],"predecessor-version":[{"id":238,"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=\/wp\/v2\/posts\/237\/revisions\/238"}],"wp:attachment":[{"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}