Definition List Tags

The HTML description list or definition list displays the items as a definition as in the dictionary. The

, and tags are used to define the description list. 1.HTML list of definitions represents a relevant term and description in the form of the list. The markup to define a single definition is quite simple. This article explains why definition lists are useful and how to use them when writing HTML documents. The idea to write this article came to me when I searched a website that provided glossaries of Internet terms, when I looked at the source code of the page, I was impressed by the fact that the author used title tags

, followed by a paragraph tag

to present the information. The site in question (www.mcu.org.uk, a site I visit regularly) has since started using a list of definitions to present its glossary. The

definition list is surrounded by and tags

. In tags, each item in a list of definitions consists of two parts: a term, followed by its definition or explanation. Instead of ,

  • each item name in
    a list is tagged with the tag,

    followed by the definition or explanation of the item marked by the tag

    . The opening list tag
    must.

    This is followed by an optional list header (label), then

    term names () and definitions (
    ). For example, description lists are useful for displaying metadata as a list of key-value pairs. The

    HTML tag is used to declare a list of definitions. This tag is

    used in the tag. Semantic markup can benefit advanced content management systems. Bob Boiko (The Content Management Bible, p. 457.) explains that metadata can be both embedded in content and maintained separately. Definition lists and other semantic markup constructs make it easy to extract structured information about your content. Another format places the left-aligned term on a wide margin and the definition on one or more lines to the right of the term. If the term DT does not fit in the DT column (one-third of the display area), it can be extended over the entire page, moving the DD section to the next row, or it can be enclosed in consecutive rows in the left column. In addition to grouping related terms together (as in the previous example), terms from different languages can also be given a common definition. Note the use of the lang attribute.

    Definition lists are not limited to simple matching of terms and descriptions, this example shows how definition lists can be used to specify a single description for multiple terms. HTML and XHTML also support a completely different list style from the ordered and unordered lists we`ve discussed so far: definition lists. Like the entries you`ll find in a dictionary or encyclopedia, with text, images, and other multimedia elements, the definition list is the perfect way to present a glossary, a list of terms, or another list of names/values. Each screen reader advertises

    content differently. Starting with iOS 14, VoiceOver

    advertises that content is a list when browsing with the virtual cursor (not via the read-all command). Therefore, make sure that the contents of each list item are written in such a way that their relationship to the other list items in the list collection is communicated. I hope this has helped to illustrate some of the possible uses for which lists of definitions can be used. With a basic understanding of how definition lists can be used, it is possible to develop useful associations between information extracts. Tools such as the Google Glossary show how meaningfully labeled information can be used more than originally intended. Websites that use semantic markup to make sense of their data can then use and reuse that information in a more flexible way, simply, than there are more possibilities for future features.

    It is possible to have both several terms and several definitions. This is useful if you define certain words that have several common meanings. 2.HTML list of definitions begins and ends with the dl element (i.e.

    and

    ). Don`t use this element (or

      elements) to create only indents on a page. While this works, it is a bad practice that obscures the importance of description lists.

      The HTML element represents a list of descriptions. The item contains a list of term groups (specified with

      the item) and descriptions (provided by

      the items).

      This element is often used to implement a glossary or display metadata (a list of key-value pairs). Unless you change the display attributes with style sheet rules, browsers typically display the name of the element or term on the left and the definition or explanation below and indented. If the definition terms are very short (usually less than three characters), the browser can place the first part of the definition on the same line as the term. See how the list of XHTML source definitions appears at the bottom of Netscape in Figure 7-8: Simply put, this is a list of definitions. For the full version, see the appropriate section in the HTML specification. Basically, a list of definitions consists of three HTML and text elements. These are the

      elements,

      and

      in practice there are several ways to increase the compactness of lists: reducing the vertical spacing of intermediate elements, smaller font size, or even avoiding line breaks between elements. It`s best to handle this through the associated style sheets and the class attribute. You can also use block-level elements in the definition description. A list of definitions can also contain a number of DT DD pairs.

      A list of definitions is a list of terms and corresponding definitions. Definition lists are usually formatted with the term on the left, followed by the definition on the right or in the next line. The definition text is usually set back from the term. The opening list tag must be DL COMPACT. He must immediately follow the first semester (DT). For example, the definition list item might take the COMPACT attribute that suggests the use of compact rendering and is appropriate if the list items are small and/or the entire list is large. This section provides some examples of how to use definition lists. If you think that only people see your site, you would be wrong. An example of an application that would be interested in DL elements is the Google glossary. This is currently a product of Google Labs and as such is in development and may move from time to time.

      What the glossary search engine does, however, is a concrete example of how using definition lists can add value to a page. By semantically labeling your content, you make processing much easier with automatic methods. At this point, you might think I`m a bit pedantic when I notice when web pages lack DL elements, because if a bunch of definitions look like a bunch of definitions, then it doesn`t matter what markup is used. This view contradicts the ethics behind HTML, lists of definitions are important because they provide context for the text with which they are associated. So why is context important? By giving context to the text, it takes on additional meaning. This is important because your website is not always seen visually, so what else is looking at your pages? A list of definitions is similar to other lists, but in a list of definitions, each list item contains two entries. a term and a description. Thank you to everyone who commented on this article and suggested improvements. If you have any comments or suggestions, please contact me with them. It is also possible to define multiple terms with multiple corresponding descriptions by combining the above examples.

      class, compact, dir, id, lang, onClick, onDblClick, onKeyDown, onKeyPress, onKeyUp, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp, style, title, type 4. The description is attached to the dd element. 5. Another use of the dl, dt, and dd elements is to create a dialog box. Each dt gives the name of the speaker and each dd contains his words. Note: Use the NOTE element if you want to have a note indented. The use

      of elements without
      matching elements is not recommended. The

      tag is used in conjunction with (

      defines terms/names) and

      (describes each term/name). To change the indentation of a description term, use the CSS-margin property. This tag supports all the global attributes described in HTML Attribute Reference: zero or more groups, each

      composed of one or more elements, followed by one or more

      elements optionally mixed with and elements .

      Or: (in WHATWG HTML, W3C HTML 5.2 and later) One or more

      elements, optionally mixed with and elements. Get HTML & XHTML: The Definitive Guide, 5th Edition now with the O`Reilly learning platform. There are also live online events, interactive content, materials to prepare for certification and much more. WHATWG HTML allows you to encapsulate any name-value group in

      an element of an

      element. This can be useful when using microdata, when global attributes apply to an entire group, or for styling purposes. The HTML elements dl, dt, and dd are part of the HTML lists. Tip: It may be useful to define a key-value delimiter in CSS, for example: using multiple descriptions to define a single term can be useful if the term you are describing actually has more than one meaning. The following example is based on an example from the HTML 4 specification.

      Yes required for the dl element and start tag, but optional end tag for the dt and dd elements.

  • Call Now