|
HTML 4.0 Attribute ValuesThere are various kinds of attribute values in HTML 4.0. This document describes common types of values. CDATAAttribute values of type CDATA are made up of a sequence of characters that may include entities. Line feeds are ignored while each carriage return and tab is replaced with a space. Browsers may ignore leading and trailing whitespace within the attribute value. CDATA attribute values are typically case-sensitive, though this is not the case with all attributes that take CDATA values. ID and NAMEAttribute values of type ID and NAME must begin with a letter in the range A-Z or a-z and may be followed by letters (A-Za-z), digits (0-9), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). These values are case-sensitive. IDREF and IDREFSIDREF and IDREFS values refer to values of other elements' ID attributes. An IDREF value is a single ID while an IDREFS value is a space-separated list of IDs. IDREF and IDREFS are case-sensitive. NumberNumber attribute values are numbers made of at least one digit in the range 0-9. TextText attribute values are CDATA values intended to be human readable strings. URIURI attribute values are Uniform Resource Identifiers (URIs), as defined in the URI Internet-Draft, a work-in-progress that is expected to replace RFC 1738 and RFC 1808. URI attribute values may include full URIs such as http://www.htmlhelp.com/ as well as relative URIs such as foo.html and ../foo/. While parts of a URI may be case-insensitive, in general URI values are case-sensitive. ColorColor attribute values give a color definition. The value can be any hexadecimal number, specified according to the sRGB color space, or one of sixteen color names. Hexadecimal numbers must be prefixed by a "#" character. The case-insensitive color names and their sRGB values are as follows:
Note that the hexadecimal form is better supported than the color names for the color attributes of BODY. PixelsThese attribute values are integers that represent a number of pixels. LengthLength attribute values may be either an integer--interpreted as a number of pixels--or a percentage of the horizontal or vertical space. The value 50% means half the available space while 50 means 50 pixels. MultiLength and MultiLengthsMultiLength attribute values may be an integer in pixels, a percentage of the horizontal or vertical space, or a relative length expressed as i* where i is an integer. In allotting space, a browser first allots pixel and percentage lengths, then divides the remaining space among all elements with a relative length. An element with a length of 3* will be allotted three times the space of an element with length 1*. The value * is equivalent to 1* and is often used to mean "fill the remaining space." A MultiLengths value is a comma-separated list of MultiLength values. ContentType and ContentTypesThese attribute values are content types (also known as media types or MIME types) of a linked or embedded resource. Values of type ContentType give a single content type while values of type ContentTypes give a comma-separated list of content types. Content types are case-insensitive. Commonly used content types include text/html, image/jpeg, model/vrml, video/quicktime, application/java, text/css, and text/javascript. Many common content types are registered at the IANA. LanguageCodeAttribute values of type LanguageCode specify a language code according to RFC 1766. Examples of language codes include en for English, en-US for American English, and ja for Japanese. Whitespace is not allowed in the language code, which is case-insensitive. Charset and CharsetsThese attribute values specify character encodings of linked resources. Values of type Charset give a single character encoding while values of type Charsets give a space- and/or comma-separated list of character encodings. Character encodings are case-insensitive. Examples of character encodings include ISO-8859-1, SHIFT_JIS, and UTF-8. A list of registered character encodings is available at the IANA. CharacterCharacter attribute values take a single Unicode character. The character may be specified with an entity. DatetimeDatetime attribute values give a date and time in the format YYYY-MM-DDThh:mm:ssTZD where YYYY is a four-digit year, MM is a two-digit month (01 through 12), DD is a two-digit day (01 through 31), hh is a two-digit hour (00 through 23), mm is a two-digit minute (00 through 59), ss is a two-digit second (00 through 59), and TZD is the time zone designator. Note that the T separating the date from the time must appear literally and is case-sensitive. The time zone designator may be one of the following:
If any of the two-digit components of the Datetime value are unknown, 00 should be used. LinkTypesAttribute values of type LinkTypes give a space-separated list of link types. A link type is case-insensitive and may not contain whitespace. Each link type may be used any number of times in a given document. While link types are case-insensitive, the Lynx browser will render LINK elements with the same case as is given in the REL or REV attribute. Authors should therefore be consistent in their case, and may wish to capitalize the first letter while using lowercase for the rest. The following link types are defined in HTML 4.0, though authors may use other link types. The Made link type, widely used as <LINK REV=Made HREF="mailto:liam@htmlhelp.com"> to provide a contact link for the document author, is notably missing from the list of link types defined in HTML 4.0.
MediaDescAttribute values of type MediaDesc are media descriptors--a comma-separated list of media for which the linked resource is tailored. Media descriptors are case-sensitive. The following media descriptors are defined in HTML 4.0:
ScriptScript attribute values are client-side scripts, typically a function call or a few short statements. The value may contain entities (e.g., "). StyleSheetAttribute values of type StyleSheet are style sheet data. The value may contain entities. FrameTargetAttribute values of type FrameTarget must begin with a letter in the range A-Z or a-z, with the exception of the following special values that begin with an underscore: |
|||||||||||||||||||||||||||||||||||||||||||||||||||
With any suggestions or questions please feel free to contact us |