2014-08-25

HTML Comment <!---->

Comment Tags <!--  --> are used to insert comments in HTML.


Struture of Comment

 <!-- Write your comments --> 

Advantage of Comment
  • Comments are not displayed by the browser, but most of the Designer and Developer using this Comment Tag <!--  --> for Future Implementation.
  • With comments you can place message, code, notifications and reminders in your HTML Document. Comments are also great for debugging HTML, because you can comment out HTML lines of code, one at a time, to search for errors:

Comment Tag with Message

<html>
<head>
<title>My First Page</title>
</head>
<body>
<!--------- header part ----------------- -->
<div id="header"></div>

<div id="container">

<!--------- sidebar part ------------------->
<span id="sidebar"></span>
<!--------- content part ------------------->
<span id="blog"></span>

</div>

<!--------- Footer part ------------------->
<div id="footer"></div>
</body>
</html>

Comment Tag with Code

<html>
<body>
<!--------- Header part ----------->
<div id="header"></div>

<div id="container">
      <!--------- Sidebar part ----------->
      <span id="sidebar"></span>
      <!--------- Content part ----------->
      <span id="blog"></span>
</div>

<!---------
Footer part
<div id="footer"></div>
-->

</body>
</html>
In this example, footer is not require currently, so we can comment it, can be use in Future

0 comments:

Post a Comment

Tools & Plugins