Movatterモバイル変換


[0]ホーム

URL:


 previous  next  contents  elements  attributes  index

6 Basic HTML data types

Contents

  1. Case information
  2. SGML basic types
  3. Text strings
  4. URIs
  5. Colors
    1. Notes on using colors
  6. Lengths
  7. Content types (MIME types)
  8. Language codes
  9. Character encodings
  10. Single characters
  11. Dates and times
  12. Link types
  13. Media descriptors
  14. Script data
  15. Style sheet data
  16. Frame target names

This section of the specification describes the basic data typesthat may appear as an element's content or an attribute's value.

For introductory information about reading the HTML DTD,please consult theSGMLtutorial.

6.1Case information

Each attribute definition includes information about thecase-sensitivity of its values. The case information ispresented with the following keys:

CS
The value is case-sensitive (i.e., user agents interpret"a" and "A" differently).
CI
The value is case-insensitive (i.e., user agents interpret"a" and "A" as the same).
CN
The value is not subject to case changes, e.g.,because it is a number or a character from thedocument character set.
CA
The element or attribute definition itself gives case information.
CT
Consult the type definition for details about case-sensitivity.

If an attribute value is a list, the keys apply to every valuein the list, unless otherwise indicated.

6.2 SGML basic types

Thedocument type definitionspecifies the syntax of HTML element content and attribute valuesusing SGML tokens (e.g., PCDATA, CDATA, NAME, ID, etc.). See[ISO8879] for their full definitions. Thefollowing is a summary of key information:

6.3Text strings

A number of attributes (%Text; in the DTD) take textthat is meant to be "human readable". For introductory information aboutattributes, please consult thetutorial discussion ofattributes.

6.4URIs

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 normativealgorithm for this process. For more 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 beURIs, or parts of URIs, where case doesn't matter (e.g., machinenames), but identifying these may not be easy. Users should alwaysconsider that URIs are case-sensitive (to be on the safe side).

Please consult the appendix for information aboutnon-ASCII characters in URIattribute values.

6.5Colors

The attribute value type "color" (%Color;) refers to colordefinitions as specified in[SRGB]. A colorvalue may either be a hexadecimal number (prefixed by a hash mark) orone of the following sixteen color names. The color names arecase-insensitive.

Color names and sRGB values
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.

6.5.1 Notes on using colors

Although colors can add significant amounts of information todocument and make them more readable, please consider the followingguidelines when including color in your documents:

6.6 Lengths

HTML specifies three types of length values forattributes:

  1. Pixels: The value(%Pixels; in the DTD) isan integer that represents the number of pixels of the canvas (screen,paper). Thus, the value "50" means fifty pixels. For normativeinformation about the definition of apixel, please consult[CSS1].
  2. Length: The value(%Length; in the DTD) may beeither a %Pixel; or a percentage of the available horizontal orvertical space. Thus, the value "50%" means half of the availablespace.
  3. MultiLength: Thevalue (%MultiLength; in the DTD)may be a %Length; or arelative length. A relative length has theform "i*", where "i" is an integer. When allotting space amongelements competing for that space, user agents allot pixel andpercentage lengths first, then divide up remaining available spaceamong relative lengths. Each relative length receives a portion of theavailable space that is proportional to the integer preceding the"*". The value "*" is equivalent to "1*". Thus, if 60 pixels of spaceare available after the user agent allots pixel and percentage space,and the competing relative lengths are 1*, 2*, and 3*, the 1* will bealloted 10 pixels, the 2* will be alloted 20 pixels, and the 3* willbe alloted 30 pixels.

Length values arecase-neutral.

6.7Content types (MIME types)

Note. A "media type" (defined in[RFC2045] and[RFC2046])specifies the nature of a linked resource. This specification employsthe term "content type" rather than "media type" inaccordance with current usage. Furthermore, in this specification,"media type" may refer to themedia where a user agentrenders a document.

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", "audio/basic", "text/tcl","text/javascript", and "text/vbscript". For the current list ofregistered MIME types, please consult[MIMETYPES].

Note. The content type"text/css", while not currentlyregistered with IANA, should be used when the linked resource is a[CSS1] style sheet.

6.8Language codes

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 onlanguage codes. Whitespaceis not allowed within the language-code.

Language codes arecase-insensitive.

6.9Character encodings

The "charset" attributes (%Charset in the DTD) refer toacharacter encoding as described in the section oncharacter encodings. Values mustbe 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 characterencodings in order to determine the character encoding of anexternal resource.

6.10Single characters

Certain attributes call for single character from thedocument character set. Theseattributes take the%Character type in the DTD.

Single characters may be specified withcharacter references (e.g.,"&").

6.11Dates and times

[ISO8601] allows many options and variations inthe representation of dates and times. The current specification usesone of the formats described in the profile[DATETIME]for its definition of legal date/time strings (%Datetime in the DTD).

The format is:

  YYYY-MM-DDThh:mm:ssTZD
where:
     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:

Z
indicates UTC (Coordinated Universal Time). The "Z" must beuppercase.
+hh:mm
indicates that the time is a local time which ishh hoursandmm minutes ahead of UTC.
-hh:mm
indicates that the time is a local time which ishh hoursandmm minutes behind UTC.

Exactly the components shown here must be present, with exactlythis punctuation. Note that the"T" appears literally inthe string (it must be uppercase), to indicate the beginning of thetime element, as specified in[ISO8601]

If a generating application does not know the time to thesecond, it may use the value "00" for the seconds (and minutes andhours if necessary).

Note.[DATETIME]does not address the issue of leap seconds.

6.12Link types

Authors may use the following recognized link types, listed here with theirconventional interpretations. In the DTD,%LinkTypes refers to aspace-separated list of link types. White space characters are notpermitted within 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 typesin a variety of ways. For example, user agents may provide accessto linked documents through a navigation bar.

Alternate
Designates substitute versions for the document in which the linkoccurs. When used together with thelangattribute, it implies a translated version of the document. When usedtogether with themedia attribute, it implies aversion designed for a different medium (or media).
Stylesheet
Refers to an external style sheet. See the section onexternal style sheetsfor details. This is used together with the link type "Alternate"for user-selectable alternate style sheets.
Start
Refers to the first document in a collection of documents. Thislink type tells search engines which document is considered by theauthor to be the starting point of the collection.
Next
Refers to the next document in an linear sequence of documents.User agents may choose to preload the "next" document, to reducethe perceived load time.
Prev
Refers to the previous document in an ordered series of documents.Some user agents also support the synonym "Previous".
Contents
Refers to a document serving as a table of contents.Some user agents also support the synonymToC (from"Table of Contents").
Index
Refers to a document providing an index for the currentdocument.
Glossary
Refers to a document providing a glossary of terms that pertainto the current document.
Copyright
Refers to a copyright statement for the current document.
Chapter
Refers to a document serving as a chapter in a collection ofdocuments.
Section
Refers to a document serving as a section in a collection ofdocuments.
Subsection
Refers to a document serving as a subsection in a collection ofdocuments.
Appendix
Refers to a document serving as an appendix in a collection ofdocuments.
Help
Refers to a document offering help (more information, links toother sources information, etc.)
Bookmark
Refers to a bookmark. A bookmark is a link to a key entry pointwithin an extended document. Thetitleattribute may be used, for example, to label the bookmark. Note thatseveral bookmarks may be defined in each document.

Authors may wish to defineadditional link types not described in this specification. Ifthey do so, they should use aprofile to cite the conventionsused to define the link types. Please see theprofile attribute of theHEADelement for more details.

For further discussions about link types, please consult thesection onlinks in HTML documents.

6.13Media descriptors

The following is a list ofrecognized media descriptors (%MediaDesc in the DTD).

screen
Intended for non-paged computer screens.
tty
Intended for media using a fixed-pitch character grid, such as teletypes, terminals, or portable devices with limited display capabilities.
tv
Intended for television-type devices (low resolution, color, limited scrollability).
projection
Intended for projectors.
handheld
Intended for handheld devices (small screen, monochrome, bitmapped graphics, limited bandwidth).
print
Intended for paged, opaque material and for documents viewed on screen in print preview mode.
braille
Intended for braille tactile feedback devices.
aural
Intended for speech synthesizers.
all
Suitable for all devices.

Future versions of HTML may introduce new values and may allowparameterized values. To facilitate the introduction of theseextensions, conforming user agents must be able toparse themedia attribute value asfollows:

  1. The value is a comma-separated list of entries. For example,
    media="screen, 3d-glasses, print and resolution > 90dpi"

    is mapped to:

    "screen""3d-glasses""print and resolution > 90dpi"
  2. Each entry is truncated just before the first character thatisn't a US ASCII letter [a-zA-Z] (Unicode decimal 65-90, 97-122),digit [0-9] (Unicode hex 30-39), or hyphen (45).In the example, this gives:
    "screen""3d-glasses""print"
  3. Acase-sensitive match is then madewith the set of media types defined above. User agents may ignoreentries that don't match. In the example we are left withscreen andprint.

Note. Style sheets mayinclude media-dependent variations within them (e.g., the CSS@media construct). In such cases it may be appropriate to use"media=all".

6.14Script data

Script data (%Script; in theDTD) can be the content of theSCRIPT element and the value ofintrinsic event attributes.User agents must not evaluate script data as HTML markup but insteadmust pass it on as data to a script engine.

Thecase-sensitivity of script data depends on the scriptinglanguage.

Please note that script data that is element content may notcontaincharacter references, butscript data that is the value of an attribute may contain them. Theappendix provides further information aboutspecifying non-HTMLdata.

6.15Style sheet data

Style sheet data (%StyleSheet; in theDTD) can be the content of theSTYLE element and the value of thestyle attribute. User agents must not evaluatestyle data as HTML markup.

Thecase-sensitivity of style data depends on the style sheetlanguage.

Please note that style sheet data that is element content may notcontaincharacter references, butstyle sheet data that is the value of an attribute may contain them. Theappendix provides further information aboutspecifying non-HTMLdata.

6.16Frame target names

Except for the reserved names listed below, frame target names(%FrameTarget; in the DTD)must begin with an alphabetic character (a-zA-Z). User agents shouldignore all other target names.

The following targetnames are reserved and have special meanings.

_blank
The user agent should load the designated document in a new,unnamed window.
_self
The user agent should load the document in the same frame as theelement that refers to this target.
_parent
The user agent should load the document into the immediateFRAMESET parent of the current frame. This valueis equivalent to_self if the current frame has no parent.
_top
The user agent should load the document into the full, originalwindow (thus cancelling all other frames). This value is equivalent to_self if the current frame has no parent.

previous  next  contents  elements  attributes  index

[8]ページ先頭

©2009-2025 Movatter.jp