Empowering Today’s Learners to Become Tomorrow’s Leaders
Placing comments in a web page helps you keep organized. A webpage can get huge very fast. Comments help mark areas of a web page.
<!-- this is a comment -->
The browser window will not display the content inside of <!-- and -->
There is no limit to the amount of information you can put into a comment, and
this is why comments are often used to hide a section of a web page temporarily.
Commenting may be preferable to deleting content, particularly if you want to
put that information back into the web page at a later date (if it’s in a comment,
you won’t have to re-type it).
Just to see how this works, create a new html file in your procedures folder and name it commentout.html as this process is often called “commenting out” markup.
Here’s an example: (this is the code for the commentout.html file)
<!doctype html>
<html>
<head>
<title>Commenting out HTML</title>
<meta charset="utf-8">
</head>
<body>
<h1>Current Stock</h1>
<p>The following items are available for order:</p>
<ul>
<li>Dark Smoke Window Tinting</li>
<li>Bronze Window Tinting</li>
<!-- <li>Spray mount</li>
<li>Craft knife (pack of 5)</li> -->
</ul>
</body>
</html>
Figure 2.11 shows how the page displays in Firefox
See how the final commented list items are not displayed?