{"id":74,"date":"2026-04-10T08:19:37","date_gmt":"2026-04-10T08:19:37","guid":{"rendered":"https:\/\/gigz.pk\/html\/?post_type=lesson&#038;p=74"},"modified":"2026-04-23T05:04:29","modified_gmt":"2026-04-23T05:04:29","slug":"comments-in-html","status":"publish","type":"lesson","link":"https:\/\/gigz.pk\/html\/index.php\/lesson\/comments-in-html\/","title":{"rendered":"Comments in HTML"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Comments in HTML are used to add notes or explanations inside your code. These notes are not visible on the webpage and are only seen by developers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Why Use Comments<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Comments help make your code easier to understand. They are useful when you want to explain what a section of code does or leave instructions for yourself or others.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">They are also helpful when working in a team, as they improve communication between developers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>How to Write Comments<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In HTML, comments are written using the following format &lt;!&#8211; This is a comment &#8211;&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Anything written inside these symbols will not be displayed in the browser.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Example<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a simple example of using comments in HTML &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Comments Example&lt;\/title&gt; &lt;\/head&gt; &lt;body&gt; &lt;!&#8211; This is a heading &#8211;&gt; &lt;h1&gt;Welcome&lt;\/h1&gt; &lt;!&#8211; This is a paragraph &#8211;&gt; &lt;p&gt;This is my website&lt;\/p&gt; &lt;\/body&gt; &lt;\/html&gt;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>When to Use Comments<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use comments to describe sections of your code.<br>Use them to temporarily disable code while testing.<br>Use them to organize large HTML files.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Summary<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Comments are an important part of writing clean and understandable code. They do not affect how the webpage looks but make development easier and more organized.<\/p>\n\n\n<div class=\"yoast-breadcrumbs\"><span><span><a href=\"https:\/\/gigz.pk\/html\/\">Home<\/a><\/span> \u00bb <span class=\"breadcrumb_last\" aria-current=\"page\">HTML Fundamentals (Beginner) > Basic HTML Structure > Comments in HTML<\/span><\/span><\/div>\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1776920686535\"><strong class=\"schema-faq-question\"><\/strong> <p class=\"schema-faq-answer\"><\/p> <\/div> <\/div>\n","protected":false},"menu_order":9,"template":"","class_list":["post-74","lesson","type-lesson","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Comments in HTML - HTML learning mastery<\/title>\n<meta name=\"description\" content=\"Learn HTML comments syntax and usage to write clean, organized code, add notes, and improve readability for better development practice.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gigz.pk\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Comments in HTML - HTML learning mastery\" \/>\n<meta property=\"og:description\" content=\"Learn HTML comments syntax and usage to write clean, organized code, add notes, and improve readability for better development practice.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gigz.pk\/\" \/>\n<meta property=\"og:site_name\" content=\"HTML learning mastery\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-23T05:04:29+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/gigz.pk\\\/html\\\/index.php\\\/lesson\\\/comments-in-html\\\/\",\"url\":\"https:\\\/\\\/gigz.pk\\\/\",\"name\":\"Comments in HTML - HTML learning mastery\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/html\\\/#website\"},\"datePublished\":\"2026-04-10T08:19:37+00:00\",\"dateModified\":\"2026-04-23T05:04:29+00:00\",\"description\":\"Learn HTML comments syntax and usage to write clean, organized code, add notes, and improve readability for better development practice.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gigz.pk\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gigz.pk\\\/html\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HTML Fundamentals (Beginner) > Basic HTML Structure > Comments in HTML\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/html\\\/#website\",\"url\":\"https:\\\/\\\/gigz.pk\\\/html\\\/\",\"name\":\"HTML learning mastery\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gigz.pk\\\/html\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Comments in HTML - HTML learning mastery","description":"Learn HTML comments syntax and usage to write clean, organized code, add notes, and improve readability for better development practice.","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:\/\/gigz.pk\/","og_locale":"en_US","og_type":"article","og_title":"Comments in HTML - HTML learning mastery","og_description":"Learn HTML comments syntax and usage to write clean, organized code, add notes, and improve readability for better development practice.","og_url":"https:\/\/gigz.pk\/","og_site_name":"HTML learning mastery","article_modified_time":"2026-04-23T05:04:29+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["WebPage","FAQPage"],"@id":"https:\/\/gigz.pk\/html\/index.php\/lesson\/comments-in-html\/","url":"https:\/\/gigz.pk\/","name":"Comments in HTML - HTML learning mastery","isPartOf":{"@id":"https:\/\/gigz.pk\/html\/#website"},"datePublished":"2026-04-10T08:19:37+00:00","dateModified":"2026-04-23T05:04:29+00:00","description":"Learn HTML comments syntax and usage to write clean, organized code, add notes, and improve readability for better development practice.","breadcrumb":{"@id":"https:\/\/gigz.pk\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gigz.pk\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/gigz.pk\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gigz.pk\/html\/"},{"@type":"ListItem","position":2,"name":"HTML Fundamentals (Beginner) > Basic HTML Structure > Comments in HTML"}]},{"@type":"WebSite","@id":"https:\/\/gigz.pk\/html\/#website","url":"https:\/\/gigz.pk\/html\/","name":"HTML learning mastery","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gigz.pk\/html\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/gigz.pk\/html\/index.php\/wp-json\/wp\/v2\/lesson\/74","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gigz.pk\/html\/index.php\/wp-json\/wp\/v2\/lesson"}],"about":[{"href":"https:\/\/gigz.pk\/html\/index.php\/wp-json\/wp\/v2\/types\/lesson"}],"wp:attachment":[{"href":"https:\/\/gigz.pk\/html\/index.php\/wp-json\/wp\/v2\/media?parent=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}