Interactive HTML Tutorial

Chapter 8: Clean HTML Code, Comments and Escape Codes

BASIC HTML
Chapter 1:
The HTML Basics
Chapter 2:
HTML Tags 1
Chapter 3:
HTML Tags 2
Chapter 4:
HTML Tags 3
Chapter 5:
Fonts and Text Colors
Chapter 6:
Links and Images
Chapter 7:
Lists Bullets etc.
Chapter 8:
Clean HTML Code
Chapter 9:
HTML Navigation
ADVANCED HTML
Chapter 10:
Tables
Chapter 11:
Using Frames
Chapter 12:
Using Meta Tags
Chapter 13:
Forms 1
Chapter 14:
Forms 2
Chapter 15:
Forms 3
Chapter 16:
Counters, Guestbooks
Chapter 17:
Graphics
Chapter 18:
HTML Style Basics
Chapter 19:
Resources

navback.gif (1039 bytes) navhome.gif (1259 bytes) navforward.gif (1051 bytes)

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.xencon.com">Xenon Web Design</a> </li>
<li> <a href="http://www.microsoft.com">Microsoft</a> </li>
<li> <a href="http://www.sybase.com">Sybase</a> </li>
<li> <a href="http://www.sybase.co.za">Sybase South Africa</a> </li>
</ul>

</body>
</html>


Save the text file as "Home.htm".

Go To Chapter 9

navback.gif (1039 bytes) navhome.gif (1259 bytes) navforward.gif (1051 bytes)