Home >> FAQs/Tutorials >> XHTML Tutorials and Tips >> Index

XHTML Tutorial - Definition List "dl" Tag/Element

By: FYIcenter.com

(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"
  <title>Definition Lists</title>
  <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>

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:
            Definition Lists

(Continued on next topic...)

  1. What Are List Elements?
  2. What Is an "ol" Tag/Element?
  3. What Is a "li" Tag/Element?
  4. Can Multiple Paragraphs Be Included in a List Item?
  5. What Is a "ul" Tag/Element?
  6. What Is a "dl" Tag/Element?
  7. Can List Elements Be Nested?
  8. How To Use Different Markers on Ordered List Items?
  9. How To Use Different Markers on Unordered List Items?

Selected Developer Jobs: