Web Design
Table of Contents
by Arnold Kling
Comments and Special Characters
In this lesson, we finish our introduction to HTML with two miscellaneous topics.
Comments

People who maintain computer code learn the value of comments. When code gets complicated, and you need to come back weeks later and change something, comments can help you find your way.

Comments are particularly helpful when you have tags that are nested, meaning that one tag is inside another tag. For example, you might create a list with four steps to solve a problem, and within the third step there could be a sub-list with several bullet points. Or you might create a table that is nested inside another table.

In HTML, comments are contained start with <!-- and end with -->. Comments are ignored by the browser. You only see them if you look at the source code.

<!-- Here are some typical sorts of comments -->
<!-- Navigation Bar Starts Here -->
<!-- 180 x 180 Ad for top left corner goes here -->

Special Characters

Some characters are part of distinct font families, which can be accessed using Cascading Style Sheets. For example, if you select font-family: Symbol; you will get Greek letters. (This will become clearer when we cover CSS, which is the next unit in the course.)

Other special characters, such as the trademark symbol, the copyright symbol, accent marks, and the greater than and less than sign, are available in HTML, using special codes. All of them must start with what is called an "escape character," which in HTML is the ampersand, &, and end with a semicolon, ;.

For example, the copyright symbol, ©, is written in HTML as &copy;.

Preparing these lectures is a pain, because < and > are special characters. I have to type &lt; to get the less than sign and &gt; to get the greater than sign. You can peek at the source code to see what I mean.

For a complete list of special characters, go to Webmonkey or The Web Developer's Virtual Library™.

Page created by Arnold Kling. Last Modified July 18, 2001.