Home >> FAQs/Tutorials >> XHTML Tutorials and Tips >> Index
XHTML Tutorial - Definition List "dl" Tag/Element
(Continued from previous topic...)
What Is a "dl" Tag/Element?
A "dl" element is block level element that can be used to define
a definition list, where items are displayed with leading terms.
Here are basic rules about "dl" elements:
- "dl" elements are block level elements.
- "dl" elements can not have text contents.
- An "dl" element must have one or more pairs of "dt" and "dd" elements as sub-elements.
- Each pair of "dt" and "dd" elements will be displayed by browsers as a term and a definition.
Below is a good tutorial example of "dl" elements:
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Definition Lists</title>
</head>
<body>
<p>Acronyms:</p>
<dl>
<dt>CSS</dt><dd>Cascading Style Sheet</dd>
<dt>DTD</dt><dd>Document Type Definition</dd>
<dt>WWW</dt><dd>World Wide Web</dd>
<dt>XML</dt><dd>eXtensible Markup Language</dd>
</dl>
</body>
</html>
If you save the above document as definition_list.html, and view it with
Internet Explorer, you will see a list of items with leading terms
as shown below:

(Continued on next topic...)
- What Are List Elements?
- What Is an "ol" Tag/Element?
- What Is a "li" Tag/Element?
- Can Multiple Paragraphs Be Included in a List Item?
- What Is a "ul" Tag/Element?
- What Is a "dl" Tag/Element?
- Can List Elements Be Nested?
- How To Use Different Markers on Ordered List Items?
- How To Use Different Markers on Unordered List Items?
|