![]() |
"id=" attribute![]() |
![]() |
"ID
Used to define a document-wide identifier. This can be used for naming positions within documents as the destination of a hypertext link. It may also be used by style sheets for rendering an element in a unique style. An ID attribute value is an SGML NAME token. NAME tokens are formed by an initial letter followed by letters, digits, "-" and "." characters. The letters are restricted to A-Z and a-z."
Further Explanations
"An SGML identifier used as the target for hypertext links or for naming particular elements in associated style sheets. Identifiers are NAME tokens and must be unique within the scope of the current document. This attribute supercedes the "NAME" attribute." (Microsoft)
HTML+ Explanation
"This can be used to define a unique identifier for the text contained by the A element. Another document can then make a reference to this by putting the identifier after the URL for this document, separated by a hash sign. The IP attribute replaces the NAME attribute in HTML." (HTML+ Discussion Document dated November 8, 1993)
In CSS1 there must be a method of attaching specific format to where that format will be used. There are three such vehicles:
- the selector (the CSS representation of the tag that will use the format),
- the class (a means of more specifically identifying where the text will be used.), and
- the ID (a tertiary method of attaching the format).
- Rules:
- only one ID per selector
- <head><style type="text/css"> h1#aardvaark { format stuff here } </style></head>
- Use:
- <H1 id=aardvaark>... stuff...
- an ID can be defined without a selector for global use
- <style type="text/css"> #aardvaark { format stuff here } </style>
- Use:
- Actual document... <h1 id=aardvaark>... stuff...
<p id=aardvaark >- "#" is the starting delimiter and a space is the ending delimiter
- when applied to the tag, the full attribute is used: