<dt> Tag Syntax
Rules for coding HTML dt
elements
<body> ... flow content expected ... <dl> ... <dt>... phrasing content ...</dt> <dd> ... flow content ... </dd> ... </dl> ... </body>
Make sure you understand the difference between a tag and element and are familiar with the definitions of namespace and other HTML terms.
- Inside a dl element, code one or more dt elements.
- Begin each dt element with a starting <dt> tag. The element name uses lower case letters and should be in the HTML namespace, which it will pick up automatically from the
xmlns
attribute on the <html> tag. - Include any HTML global attributes on the <dt> tag as appropriate.
- Inside the dt element, between the
<dt>
starting tag and the</dt>
ending tag, code the inner HTML phrasing content for the definition term. - When marking up a dt element with editing tags (<ins> or <del>), code the <ins> tag or <del> tag inside the <dt> tag.
- End the dt element with a matching
</dt>
closing tag.
<dt> Content Model
Content of the dt element
The content of the dt element can include HTML comments, text content and only those HTML tags that can be used in phrasing content.
Validation Errors
If an element that is restricted for use in flow content is included in the inner HTML code of the dt element, the W3C Markup Validation Service will report an error like this:
Line line#, Column col#: HTML element element not allowed as child of HTML element dt in this context. Contexts in which element element may be used: Where flow content is expected. Content model for element dt: Phrasing content.Other tools that validate HTML code may report a similar error. In electronic publishing, for example:
element "element" from namespace "http://www.w3.org/1999/xhtml" not allowed in this contextTo resolve this type of error, remove the tag(s) in error from the inner HTML of the dt element, which is restricted to phrasing content, or move the element(s) into a dd element or outside of the definition list, to a location where flow content is allowed.