See also Swedish translation (done by others in their own site)
TIP: When you put comments in your HTML code, begin
the comment with
Many people who attempt to put comments into their HTML code -- text intended for the reference of the developer but not to be displayed by the browser -- get the syntax wrong, which can cause some browsers to mistakenly display part of the comment, or even worse, consider big chunks of the rest of the document to be a comment and ignore them. This widespread confusion about comment syntax is understandable given that HTML comment syntax is a rather inscrutable outgrowth of SGML (Standard Generalized Markup Language), a language devised for the formatting of government documents which formed the basis of HTML. Maybe some of the same people who devised the 1040 tax forms also created the syntax rules for SGML, and hence HTML.
While the popular conception is that comments open with
But since you don't want to have to be so careful in counting your pairs
of dashes, it's better not to include any double dashes anywhere in a
comment line, so you can be sure the proper syntax is followed. This
(recommended to hide it from older browsers), since "--" is frequently
encountered as a decrement operator. You'll have to use your best judgment
operator, or live with a malformed "comment" that probably won't crash
the common browsers which are used to dealing with such bad syntax anyway.
Just try not to use comments like
Another flawed syntax sometimes used is
If you use any automated program to generate HTML code, such as a WYSIWYG editor or a program that generates HTML from a spreadsheet or database, watch out for malformed comments these programs may insert; unfortunately, the authors of such software sometimes get the comment syntax wrong and inflict this on all their users.
NOTE: One of the many ways HTML 5.0 "dumbs down" the standards
is that it has dropped all attempts to comply with SGML rules, and instead
adopts simplified comment syntax rules that don't include many of these
complexities; comments are simply delimited by
This page was first created 04 Aug 1997, and was last modified 06 Apr 2002.