Contents
This section of the specification describes the basic data types that mayappear as an element's content or an attribute's value.
For introductory information about reading the HTML DTD, please consult theSGML tutorial.
Each attribute definition includes information about thecase-sensitivity of its values. The case information is presentedwith the following keys:
If an attribute value is a list, the keys apply to every value in the list,unless otherwise indicated.
Thedocument type definition specifies thesyntax of HTML element content and attribute values using SGML tokens (e.g.,PCDATA, CDATA, NAME, ID, etc.). See[ISO8879] for their fulldefinitions. The following is a summary of key information:
User agents may ignore leading and trailing white space in CDATA attributevalues (e.g., " myval " may be interpreted as"myval"). Authors should not declare attribute values with leading or trailingwhite space.
For some HTML 4 attributes with CDATA attribute values, the specificationimposes further constraints on the set of legal values for the attribute thatmay not be expressed by the DTD.
Although the
A number of attributes (%Text; in the DTD) take text that is meant tobe "human readable". For introductory information about attributes, pleaseconsult thetutorial discussion ofattributes.
This specification uses the term URI as defined in[URI] (see also[RFC1630]).
Note that URIs include URLs (as defined in[RFC1738] and[RFC1808]).
Relative URIs are resolved to full URIs using a base URI.[RFC1808], section 3, defines the normative algorithm for this process. Formore information about base URIs, please consult the section onbase URIs in the chapter onlinks.
URIs are represented in the DTD by the parameter entity%URI;.
URIs in general arecase-sensitive.There may be URIs, or parts of URIs, where case doesn't matter (e.g., machinenames), but identifying these may not be easy. Users should always considerthat URIs are case-sensitive (to be on the safe side).
Please consult the appendix for information aboutnon-ASCII characters in URI attributevalues.
The attribute value type "color" (%Color;) refers to color definitions asspecified in[SRGB]. A color value may either be a hexadecimal number(prefixed by a hash mark) or one of the following sixteen color names. Thecolor names arecase-insensitive.
![]() | Black = "#000000" | ![]() | Green = "#008000" |
![]() | Silver = "#C0C0C0" | ![]() | Lime = "#00FF00" |
![]() | Gray = "#808080" | ![]() | Olive = "#808000" |
![]() | White = "#FFFFFF" | ![]() | Yellow = "#FFFF00" |
![]() | Maroon = "#800000" | ![]() | Navy = "#000080" |
![]() | Red = "#FF0000" | ![]() | Blue = "#0000FF" |
![]() | Purple = "#800080" | ![]() | Teal = "#008080" |
![]() | Fuchsia = "#FF00FF" | ![]() | Aqua = "#00FFFF" |
Thus, the color values "#800080" and "Purple" both refer to the colorpurple.
Although colors can add significant amounts of information to documents andmake them more readable, please consider the following guidelines whenincluding color in your documents:
HTML specifies three types of length values for attributes:
Length values arecase-neutral.
Note. A "media type" (defined in[RFC2045] and[RFC2046])specifies the nature of a linked resource. This specification employs the term"content type" rather than "media type" in accordance with current usage.Furthermore, in this specification, "media type" may refer to themedia where a user agent renders adocument.
This type is represented in the DTD by%ContentType;.
Content types arecase-insensitive.
Examples of content types include "text/html", "image/png", "image/gif","video/mpeg", "text/css", and "audio/basic". For the current list of registeredMIME types, please consult[MIMETYPES].
The value of attributes whose type is a language code (%LanguageCode in the DTD) refers to a language code as specified by[RFC1766], section 2. For information on specifying language codes in HTML,please consult the section onlanguagecodes. Whitespace is not allowed within the language-code.
Language codes arecase-insensitive.
The "charset" attributes (%Charset in the DTD) refer to acharacter encoding as described in thesection oncharacter encodings. Valuesmust be strings (e.g., "euc-jp") from the IANA registry (see[CHARSETS] for a complete list).
Names of character encodings arecase-insensitive.
User agents must follow the steps set out in the section onspecifying character encodings in orderto determine the character encoding of an external resource.
Certain attributes call for a single character from thedocument character set. These attributes takethe%Character type in the DTD.
Single characters may be specified withcharacter references (e.g., "&").
[ISO8601] allows many options and variations in the representation of datesand times. The current specification uses one of the formats described in theprofile[DATETIME] for its definition of legal date/time strings (
The format is:
YYYY-MM-DDThh:mm:ssTZDwhere:
YYYY = four-digit year MM = two-digit month (01=January, etc.) DD = two-digit day of month (01 through 31) hh = two digits of hour (00 through 23) (am/pm NOT allowed) mm = two digits of minute (00 through 59) ss = two digits of second (00 through 59) TZD = time zone designator
The time zone designator is one of:
Exactly the components shown here must be present, with exactly thispunctuation. Note that the"T" appears literally in the string (itmust be uppercase), to indicate the beginning of the time element, as specifiedin[ISO8601]
If a generating application does not know the time to the second, it may usethe value "00" for the seconds (and minutes and hours if necessary).
Note.[DATETIME] does notaddress the issue of leap seconds.
Authors may use the following recognizedlinktypes, listed here with their conventional interpretations. In theDTD,%LinkTypes refers to aspace-separated list of link types. White space characters are not permittedwithin link types.
These link types arecase-insensitive, i.e., "Alternate" has the same meaning as"alternate".
User agents, search engines, etc. may interpret these link types in avariety of ways. For example, user agents may provide access to linkeddocuments through a navigation bar.
Authors may wish to defineadditional linktypes not described in this specification. If they do so, theyshould use aprofile to cite theconventions used to define the link types. Please see theprofile attribute of theHEAD element for moredetails.
For further discussions about link types, please consult the section onlinks in HTML documents.
The following is a list ofrecognized mediadescriptors (%MediaDesc in the DTD).
Future versions of HTML may introduce new values and may allow parameterizedvalues. To facilitate the introduction of these extensions, conforming useragents must be able toparse themedia attribute value as follows:
media="screen, 3d-glasses, print and resolution > 90dpi"
is mapped to:
"screen""3d-glasses""print and resolution > 90dpi"
"screen""3d-glasses""print"
Note. Style sheets may include media-dependentvariations within them (e.g., the CSS@media construct). Insuch cases it may be appropriate to use "media=all".
Script data (%Script; in theDTD) can be the content of theSCRIPT element and the value ofintrinsic event attributes. Useragents must not evaluate script data as HTML markup but instead must pass it onas data to a script engine.
Thecase-sensitivity of script data depends on thescripting language.
Please note that script data that is element content may not containcharacter references, but script data that isthe value of an attribute may contain them. The appendix provides furtherinformation aboutspecifying non-HTML data.
Style sheet data (%StyleSheet; in theDTD) can be the content of theSTYLE element and the value of thestyle attribute. User agents must not evaluate style data as HTMLmarkup.
Thecase-sensitivity of style data depends on the stylesheet language.
Please note that style sheet data that is element content may not containcharacter references, but style sheet datathat is the value of an attribute may contain them. The appendix providesfurther information aboutspecifying non-HTML data.
Except for the reserved names listed below, frame target names (%FrameTarget; in the DTD) mustbegin with an alphabetic character (a-zA-Z). User agents should ignore allother target names.
The followingtargetnames are reserved and have special meanings.