Syntax rules

In this overview of tags, I have used some simple rules to make the syntax clear. It also allows me to provide the information in a short format.

To illustrate the syntax rules, here's the section on IMG:


Appearance: <IMG SRC=URL>
Attributes: SRC=URL, ALT=string, ALIGN=left|right|top|middle|bottom, HEIGHT=n, WIDTH=n, BORDER=n, HSPACE=n, VSPACE=n, USEMAP=URL, ISMAP
Contents: None (Empty).
May occur in: BODY, H1, H2, H3, H4, H5, H6, P, LI, DT, DD, DIV, CENTER, BLOCKQUOTE, FORM, TD, TH, PRE, ADDRESS as well as TT, I, B, U, STRIKE, BIG, SMALL, SUP, SUB, EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, A, IMG, FONT, APPLET, BR, SCRIPT, MAP, BASEFONT, INPUT, SELECT, TEXTAREA and plain text.

The first section, Appearance, gives a common way to use this tag. As you can see here, the IMG tag does not have an ending tag. If the beginning or ending tag appears inside square brackets, it is optional and may be left off.

The next section describes the attributes for the IMG tag. If an attribute appears in bold, it is required, otherwise it may be omitted. In the above case, SRC is required, but the other attributes are not. Note that the attributes themselves are listed in all caps, and the possible values (if possible) in lower case. Note that an attribute value must be quoted if it contains more than just letters, digits, hyphens and periods.

The contents section describes which tags are permitted inside this tag. For IMG, there are none. And last, you can see which tags allow IMG inside them.

The attributes and their values are noted in a very compact format as well. The "|" character is used to separate mutually exclusive attributes or values. For example, A=foo|bar indicates that attribute "A" may get foo or bar as value, but not both, or anything else. A=string|B=string indicates that you may use either A or B, but not both.

If an attribute can take more possible values than can be given in a list, the following special symbols are used:

n
A number. It must be an integer, and not have a "-" or "+" sign prepended. Numbers do not have to be enclosed in quotes.
p%
A percentage. The percentage must also be an integer. Exactly what the percentage applies to depends on the tag. Percentages must be enclosed in quotes.
URL
An URL. This can be an absolute or a relative URL, depending on the situation. In most cases, both are permitted. It is recommended that URLs always be enclosed in quotes.
string
A string of characters. Any character is permitted, including entities. It is recommended that strings are always enclosed in quotes.
#RRGGBB
A color code, in hexadecimal notation. The color is constructed in the red-green-blue format. Each part gets a hexadecimal number between 00 and FF, and it should be given in two digits at all times. Note that a color code must have a # as the first character, and it must be enclosed in quotes.

Web Design Group
Reference index ~ Wilbur index ~ Tag overview ~ Feedback

Copyright © 1997 Arnoud "Galactus" Engelfriet.