SQL PHP HTML JavaScript articles and free code If you are facing any problem in viewing this page, please tell us
 

HTML comments code


Comments are used in html to hide some text or code from the browser. Usually comments are used to explain a part of the code to the designer or coder. Some time to break the coding area and to mark different landmark portions, comments are used. The main reason is HTML comments are not displayed by the browser. So in any portion of the text or code we don’t want to be displayed or to be ignored by the browser but should stay in the file then we should use comments in html code.

Note that the comments will be available for viewing if we check the view – source code of the page.

If we are using any server side scripting language like PHP then the comments for PHP will not be available to the browser.

Writing comments in any language is a good practice and it makes the code maintenance easy.

Here is the code to generate comments in html

<!-- this text is commented and not visible -->
<br>
<!plus2net , this is also comment >
<br>
<!--- plus2net > this is not inside comment
<br>


Here you can see any > symbol will end the comment and the text after this > symbol will be displayed by the browser.

So a comment area starts with <!-- and then ends with --> and does not contain > or – in the body of the commented text or code.




Sections
PHP
JavaScript
ASP
HTML
SQL
Photoshop
Articles SEO
List of HTML Tutorial
HTML Tags
HTML Calendar
Tags on web page
Web Design
Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.