HTML and CSS Reference
In-Depth Information
<! DOCTYPE HTML >
< html >
< head >
< title > Use Comments in Your Code </ title >
</ head >
< body >
< h2 > Comments Are Important </ h2 >
<!--Notice that the header uses an h2 element instead of an h1 element.-->
Comments help you remember and show others your page design plan. < br />
Here are some different uses:
< h5 > 1. Explain to others what you are doing. </ h5 >
<!--This page is explaining comments.-->
< h5 > 2. Provide specific directions for tags to use. </ h5 >
<!--Don't use bullet points (<ul>). We haven't learned how to do that yet.-->
< h5 > 3. List the hexadecimal values for your color scheme. </ h5 >
<!-- Only use the following color values on this page: 69675C, 69623D, ECE8CF,
E8D986, B5AA69.-->
< h5 > 4. Remember to recharge your portable computer. </ h5 >
<!--After working for two hours on coding, don't forget to recharge your battery!
Otherwise, you may lose everything.-->
< h5 > 5. Remind yourself that you have a life away from computers. </ h5 >
<!--Don't forget your date with Lola on Friday night!-->
</ body >
</ html >
36
As you can see when you load the page none of the comments is visible in the browser, but as
soon as you go back to work coding the Web page, they'll be there. You can put any kind of
text in a comment container and it won't get in the way of what you see.
One of the many uses of comment tags is what's called commenting out (using your comment
tags to temporarily remove tags that you may want to keep around for later use). So, instead of
deleting the tags, all you do is to put comment tags around them, and test your page to see if
you like it better without the tags in question. If you think that it looked better in the original,
you just remove the comment tags. If the page looks better without the commented-out tags,
just remove the tags permanently.
For example, suppose, you're wondering whether a page you're preparing for a client looks
better or worse with a subheading and footnote. Here's the original code with the subheading:
<! DOCTYPE HTML >
< html >
< head >
< title > Commenting Out </ title >
</ head >
< body >
<header>
< h1 > Eat at Joe's Restaurant </ h1 >
< h2 > *Has passed most health inspections since 2005 </ h2 >
</header>
 
Search WWH ::




Custom Search