HTML Comments – HTML Tutorial

This “HTML Comments” post provides how to write comments in HTML page. Comments are used to provide the description to read about instructions that will not affect the code.


HTML Comments:

  • Comment tags <!– and –> are used to insert comments in HTML.
  • There is an exclamation point (!) in the opening tag, but not in the closing tag.
  • Comments are not displayed by the browser, but they can help document your HTML.
  • Using comments, we can provide the description about HTML document.
  • With comments you can place notifications and reminders in your HTML.

<!DOCTYPE html>
<html>
<body>
<!– This is a comment –>
<p>This is a paragraph.</p>
<!– Comments are not displayed in the browser –>
</body>
</html>

  • We can comment multiple lines, by which we can execute only blocks of code in the HTML document in the process of debugging.

<!DOCTYPE html>
<html>
<body>
<!– Do not display this at the moment
<img border=”0″ src=”pic_mountain.jpg” alt=”Mountain”>
–>
</body>
</html>


Next Topic:                         HTML style Object – HTML Tutorial

Share this