HTML and CSS Reference
In-Depth Information
15.5. Element Attributes
The final piece of the DTD puzzle involves attributes. You know attrib-
utes: they are the name/value pairs included with tags in your doc-
uments that control the behavior and appearance of those tags. To
define attributes and their allowed values within an XML DTD, use the
<!ATTLIST> directive:
<!ATTLIST element attributes >
The element is the name of the element to which the attributes apply. The
attributes are a list of attribute declarations for the element. Each at-
tribute declaration in this list consists of an attribute name, its type, and
its default value, if any.
15.5.1. Attribute Values
Attribute values can be of several types, each denoted in an attribute
definition with one of the following keywords:
CDATA
Indicates that the attribute value is a character or string of char-
acters. This is the attribute type you would use to specify URLs or
other arbitrary user data. For example, the src attribute of the <img>
tag in HTML has a value of CDATA .
ID
Indicates that the attribute value is a unique identifier within the
scope of the document. This attribute type is used with an attribute,
such as the HTML id attribute, whose value defines an ID within the
document, as discussed in "Core Attributes" in Appendix B .
 
Search WWH ::




Custom Search