Chapter 8: Clean Code,
Comments, and Escape Codes
Clean Code...
Clean code means that your HTML coding follows all
specifications. Here are a few ways to keep your code clean:
The Comment Tag...
If you are writing an HTML document, sometimes you may want to
put little reminders to yourself with your code so that you will
be able to interpret your coding better. A comment will not
appear in a web browser when the page is displayed... it is only
visible when the source code is viewed. You start commented text
with <!-- and end it
with -->.
Your own HTML page...
Add the following to your HTML page ("Home.htm"): (the
blue text is what to add)
<html>
<head><title>My Home Page</title></head>
<!-- The body starts here - and
a background image is loaded -->
<body background="bgnd.gif">
<!-- This is a heading, in blue
-->
<center><font
color="Blue"><h1>YOURNAME's Home
Page</h1></font></center>
<!-- This is a horizontal line
-->
<hr>
<!-- My name and the two images
are all part of a link - which is a "mailto" link
-->
This is the home page of <a
href="mailto:YOUR EMAIL ADDRESS"><img
src="bullet.gif"
border=0><b>YOURNAME</b>.<img
src="bullet.gif" border=0></a>
<p>Type something about yourself here. Describe briefly who
you are and what you do for a living. Remember to use bold and
italic text, for emphasis.</p>
<hr>
<h2>My favourite Web Sites</h2>
<br>
<!-- This list is an unordered
list -->
<ul>
<li> <a
href="http://www.AD-Line.com">AD-Line HTML
Tutor</a> </li>
<li> <a
href="http://www.microsoft.com">Microsoft</a>
</li>
<li> <a
href="http://www.yahoo.com">Yahoo</a>
</li>
<li> <a
href="http://www.healthcentral.com">Health
Central</a> </li>
</ul>
</body>
</html>
Save the text file as "Home.htm".
Go To Chapter 9