{"id":2263,"date":"2013-03-06T15:57:23","date_gmt":"2013-03-06T15:57:23","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2013\/03\/06\/comment-php-javascript-html-css-code\/"},"modified":"2021-08-16T23:19:54","modified_gmt":"2021-08-17T03:19:54","slug":"comment-php-javascript-html-css-code","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/","title":{"rendered":"How do I comment my HTML, CSS, JavaScript, and PHP code?"},"content":{"rendered":"<p>When you are designing your website, there are many instances that require you to <strong>comment out code in your website<\/strong>. Commenting code is good for diagnosing website problems, hiding code instead of deleting the code, placing notes in a file to explain what was done, and many more reasons. This article will explain the basics of commenting code in your website files.<\/p>\n<h2>HTML Comments<\/h2>\n<p>HTML comments are specifically designed to comment out code when you are in an <a href=\"\/support\/edu\/joomla\/joomla-2-5\/html-and-links\/\" target=\"_blank\" rel=\"noopener noreferrer\">HTML<\/a> coded document. Below is the syntax for HTML comments.<\/p>\n<h3>HTML comment<\/h3>\n<pre style=\"color: #999999;\">&lt;!-- &lt;code to be commented out&gt;  --&gt;<\/pre>\n<h3>Example of an HTML comment<\/h3>\n<p>An Example of a usage of this is shown in the following code.<\/p>\n<pre style=\"color: #336699;\">&lt;html&gt;&lt;head&gt;\n&lt;title&gt;Document&lt;\/title&gt; \n&lt;\/head&gt;&lt;body&gt;\n<span style=\"color: #999999;\">&lt;!-- This is a comment --&gt;<\/span>\n&lt;p&gt;A paragraph in your site&lt;\/p&gt;\n<span style=\"color: #999999;\">&lt;!-- This is code commented out &lt;h1&gt;Commented Title&lt;\/h1&gt; &lt;p&gt;A paragraph that is commented out.&lt;\/p&gt; --&gt;<\/span>\n&lt;\/body&gt;&lt;\/html&gt;<\/pre>\n<h2>CSS, JavaScript, and PHP Comments<\/h2>\n<p>CSS comments are done in the <a href=\"\/support\/website\/the-benefits-of-css\/\" target=\"_blank\" rel=\"noopener noreferrer\">CSS<\/a> <em>.css<\/em> stylesheet or in the Internal Style sheet. <a href=\"\/support\/website\/website-design\/javascript-failure-jquery-update\/\" target=\"_blank\" rel=\"noopener noreferrer\">JavaScript<\/a> comments can be placed inside HTML documents or in a <em>.js<\/em> file where JavaScript is ran. PHP code will be in <em>.php<\/em> files between <code> &lt;?php<\/code> and <code> ?&gt; <\/code> code. The following code shows the syntax for commenting out CSS, JavaScript, and PHP code.<\/p>\n<h3>Single Line comment<\/h3>\n<pre style=\"color: #999999;\">\/\/ &lt;code to be commented out&gt;<\/pre>\n<h3>Multiple Line comment<\/h3>\n<pre style=\"color: #999999;\">\/* &lt;code to be commented out&gt; &lt;Other code to be commented out&gt; &lt;Some more code to be commented out&gt; *\/<\/pre>\n<h3>Example of PHP comment<\/h3>\n<p>An Example of a usage of this is shown in the following code. Below is showing PHP code; however, you use the same process to comment JavaScript and CSS.<\/p>\n<pre style=\"color: #ff0000;\"><span style=\"color: #336699;\">&lt;html&gt;&lt;body&gt;<\/span> \n&lt;?php   \n<span style=\"color: #ea7500;\">\/\/ This is a comment on one line<\/span> \necho '&lt;p&gt;HTML code echoed by PHP.&lt;\/p&gt;'; <span style=\"color: #ea7500;\">\/* This is code commented out echo '&lt;h1&gt;An HTML Title from PHP&lt;\/h1&gt;'; echo '&lt;p&gt;HTML code echoed by PHP.&lt;\/p&gt;'; *\/<\/span> ?&gt; \n<span style=\"color: #336699;\">&lt;\/body&gt;&lt;\/html&gt;<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>When you are designing your website, there are many instances that require you to comment out code in your website. Commenting code is good for diagnosing website problems, hiding code instead of deleting the code, placing notes in a file to explain what was done, and many more reasons. This article will explain the basics<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/\"> Read More ><\/a><\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4288],"tags":[],"class_list":["post-2263","post","type-post","status-publish","format-standard","hentry","category-website"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How do I comment my HTML, CSS, JavaScript, and PHP code?<\/title>\n<meta name=\"description\" content=\"This article will teach you how to comment your HTML, CSS, JavaScript, and PHP code.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How do I comment my HTML, CSS, JavaScript, and PHP code?\" \/>\n<meta property=\"og:description\" content=\"This article will teach you how to comment your HTML, CSS, JavaScript, and PHP code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2013-03-06T15:57:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-17T03:19:54+00:00\" \/>\n<meta name=\"author\" content=\"InMotion Hosting Contributor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InMotion Hosting Contributor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/\"},\"author\":{\"name\":\"InMotion Hosting Contributor\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/0ba9f3ef6fadef71df5aa120ff996c41\"},\"headline\":\"How do I comment my HTML, CSS, JavaScript, and PHP code?\",\"datePublished\":\"2013-03-06T15:57:23+00:00\",\"dateModified\":\"2021-08-17T03:19:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/\"},\"wordCount\":219,\"commentCount\":33,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Website\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/\",\"name\":\"How do I comment my HTML, CSS, JavaScript, and PHP code?\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2013-03-06T15:57:23+00:00\",\"dateModified\":\"2021-08-17T03:19:54+00:00\",\"description\":\"This article will teach you how to comment your HTML, CSS, JavaScript, and PHP code.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How do I comment my HTML, CSS, JavaScript, and PHP code?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/0ba9f3ef6fadef71df5aa120ff996c41\",\"name\":\"InMotion Hosting Contributor\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/jamesr\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How do I comment my HTML, CSS, JavaScript, and PHP code?","description":"This article will teach you how to comment your HTML, CSS, JavaScript, and PHP code.","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:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/","og_locale":"en_US","og_type":"article","og_title":"How do I comment my HTML, CSS, JavaScript, and PHP code?","og_description":"This article will teach you how to comment your HTML, CSS, JavaScript, and PHP code.","og_url":"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2013-03-06T15:57:23+00:00","article_modified_time":"2021-08-17T03:19:54+00:00","author":"InMotion Hosting Contributor","twitter_card":"summary_large_image","twitter_creator":"@InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"InMotion Hosting Contributor","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/"},"author":{"name":"InMotion Hosting Contributor","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/0ba9f3ef6fadef71df5aa120ff996c41"},"headline":"How do I comment my HTML, CSS, JavaScript, and PHP code?","datePublished":"2013-03-06T15:57:23+00:00","dateModified":"2021-08-17T03:19:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/"},"wordCount":219,"commentCount":33,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Website"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/","url":"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/","name":"How do I comment my HTML, CSS, JavaScript, and PHP code?","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2013-03-06T15:57:23+00:00","dateModified":"2021-08-17T03:19:54+00:00","description":"This article will teach you how to comment your HTML, CSS, JavaScript, and PHP code.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/comment-php-javascript-html-css-code\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"How do I comment my HTML, CSS, JavaScript, and PHP code?"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/0ba9f3ef6fadef71df5aa120ff996c41","name":"InMotion Hosting Contributor","url":"https:\/\/www.inmotionhosting.com\/support\/author\/jamesr\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":null,"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2263","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=2263"}],"version-history":[{"count":4,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2263\/revisions"}],"predecessor-version":[{"id":84878,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2263\/revisions\/84878"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=2263"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=2263"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=2263"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}