blank.gif (43 bytes)

Church Of The
Swimming Elephant

3.2.4. Attributes Connected: An Internet Encyclopedia
3.2.4. Attributes

Up: Connected: An Internet Encyclopedia
Up: Requests For Comments
Up: RFC 1866
Up: 3. HTML as an Application of SGML
Up: 3.2. HTML Lexical Syntax
Prev: 3.2.3. Names
Next: 3.2.5. Comments

3.2.4. Attributes

3.2.4. Attributes

In a start-tag, white space and attributes are allowed between the element name and the closing delimiter. An attribute specification typically consists of an attribute name, an equal sign, and a value, though some attribute specifications may be just a name token. White space is allowed around the equal sign.

The value of the attribute may be either:

  • A string literal, delimited by single quotes or double quotes and not containing any occurrences of the delimiting character.

      NOTE - Some historical implementations consider any occurrence of the `>' character to signal the end of a tag. For compatibility with such implementations, when `>' appears in an attribute value, it should be represented with a numeric character reference. For example, `<IMG SRC="eq1.jpg" alt="a>b">' should be written `<IMG SRC="eq1.jpg" alt="a&#62;b">' or `<IMG SRC="eq1.jpg" alt="a&gt;b">'.

  • A name token (a sequence of letters, digits, periods, or hyphens). Name tokens are not case sensitive.

      NOTE - Some historical implementations allow any character except space or `>' in a name token.

In this example, <img> is the element name, src is the attribute name, and `http://host/dir/file.gif' is the attribute value:

   <img src='http://host/dir/file.gif'>

A useful technique for computing an attribute value literal for a given string is to replace each quote and white space character by an entity reference or numeric character reference as follows:

                     ENTITY      NUMERIC
           --------- ----------  -----------  ---------------------
             HT                  &#9;         Tab
             LF                  &#10;        Line Feed
             CR                  &#13;        Carriage Return
             SP                  &#32;        Space
             "       &quot;      &#34;        Quotation mark
             &       &amp;       &#38;        Ampersand

For example:

   <IMG SRC="image.jpg" alt="First &quot;real&quot; example">

The `NAMELEN' parameter in the SGML declaration (9.5, "SGML Declaration for HTML") limits the length of an attribute value to 1024 characters.

Attributes such as ISMAP and COMPACT may be written using a minimized syntax (see "Omitted Attribute Name" in [SGML]). The markup:

   <UL COMPACT="compact">

can be written using a minimized syntax:


    NOTE - Some historical implementations only understand the minimized syntax.

Next: 3.2.5. Comments

Connected: An Internet Encyclopedia
3.2.4. Attributes


Protect yourself from cyberstalkers, identity thieves, and those who would snoop on you.
Stop spam from invading your inbox without losing the mail you want. We give you more control over your e-mail than any other service.
Block popups, ads, and malicious scripts while you surf the net through our anonymous proxies.
Participate in Usenet, host your web files, easily send anonymous messages, and more, much more.
All private, all encrypted, all secure, all in an easy to use service, and all for only $5.95 a month!

Service Details

Have you gone to church today?
All pages ©1999, 2000, 2001, 2002, 2003 Church of the Swimming Elephant unless otherwise stated
Church of the Swimming Elephant©1999, 2000, 2001, 2002, 2003 is a wholly owned subsidiary of Packetderm, LLC.

Packetderm, LLC
210 Park Ave #308
Worcester, MA 01609