DL - Definition ListsPermitted Context: %Body.Content, %flow, %blockContent Model: Optional list header(LH), followed by one or more terms(DT) and definitions(DD). A definition list is a list of terms and corresponding definitions. Definition lists are typically formatted with the term on the left with the definition following on the right or on the next line. The definition text is typically indented with respect to the term. Show An alternative format places the term left aligned in a wide margin and the definition on one or more lines to the right of the term. If the DT term does not fit in the DT column (one third of the display area), it may be extended across the page with the DD section moved to the next line, or it may be wrapped onto successive lines of the left hand column. The opening list tag must be <DL>. It is followed by an optional list header (<LH>caption</LH>) and then by term names (<DT>) and definitions (<DD>). For example: <DL> <LH>List Header</LH> <DT>Term 1<dd>This is the definition of the first term. <DT>Term 2<dd>This is the definition of the second term. </DL>which could be rendered as: List HeaderTerm 1This is the definition of the first term.Term 2This is the definition of the second term.The definition list element can take the COMPACT attribute, which suggests that a compact rendering be used, and is appropriate if the list elements are small and/or the entire list is large. Note: Use the NOTE element when you want to have an indented note. The practice of using <DD> elements without corresponding <DT> elements is deprecated. Permitted Attributes for the DL ElementIDAn SGML identifier used as the target for hypertext links or for naming particular elements in associated style sheets. Identifiers are NAME tokens and must be unique within the scope of the current document.LANGThis is one of the ISO standard language abbreviations, e.g. "en.uk" for the variation of English spoken in the United Kingdom. It can be used by parsers to select language specific choices for quotation marks, ligatures and hypenation rules etc. The language attribute is composed from the two letter language code from ISO 639, optionally followed by a period and a two letter country code from ISO 3166.CLASSThis a space separated list of SGML NAME tokens and is used to subclass tag names. By convention, the class names are interpreted hierarchically, with the most general class on the left and the most specific on the right, where classes are separated by a period. The CLASS attribute is most commonly used to attach a different style to some element, but it is recommended that where practical class names should be picked on the basis of the element's semantics, as this will permit other uses, such as restricting search through documents by matching on element class names. The conventions for choosing class names are outside the scope of this specification.CLEARThis attribute is common to all block-like elements. When text flows around a figure or table in the margin, you sometimes want to start an element like a header, paragraph or list below the figure rather than alongside it. The CLEAR attribute allows you to move down unconditionally:clear=leftmove down until left margin is clearclear=rightmove down until right margin is clearclear=allmove down until both margins are clear Alternatively, you can decide to place the element alongside the figure just so long as there is enough room. The minimum width needed is specified as: The style sheet (or browser defaults) may provide default minimum widths for each class of block-like elements. In practice, there are several ways to increase the compactness of lists: reduced vertical interitem spacing, smaller font size, or even to avoid line breaks between items. This is best handled through associated style sheets and the class attribute. The opening list tag must be DL COMPACT. It must be immediately followed by the first term (DT). For example: <DL compact> <DT>Term<DD>This is the first definition in compact format. <DT>Term<DD>This is the second definition in compact format. </DL>10 ListsContents
So what is a definition list?Simply put it is a list of definitions. For the unabridged version read therelevant section in the HTML specification. Basically a definition list is composed of three HTML elements and some text. These are the <dl>, <dt> and <dd> elements. HTML ListsIn this tutorial you will learn how to create different types of lists in HTML. Use Definition Lists for Detailed StepsA definition list is a list of terms (or numbers) and corresponding definitions or descriptions. We like using definition lists in our articles to give readers a clear view of the steps required to complete a task, but just about anything fits in a list. This article will teach you how to use definition lists in Docs. In this article
Creating Lists in the HTML EditorThe definition list element ( <dl>) contains a term (<dt>) and a description (<dd>). To create your list, you can either:
Check out the list below and take a look at how it's marked-up in HTML. The step number is our definition term <dt> and the corresponding instruction text is the definition description <dd>. Note: By default, the number background in a definition list is grey. We're using custom CSS to make our number background blue. If you're using your own stylesheet, you can change the term background color with: #fullArticle dt { background: #3197D1; }Common QuestionsWill lists work in all browsers? Description ListsThe HTML Beginner Tutorial looked at unordered lists and ordered lists, but, much like Peter Cushing’s Doctor Who, description lists are quite often forgotten. This is maybe because they are much more specific than ordered and unordered lists and therefore less useful, generally, but where there is a list of terms and descriptions (such as a glossary), a description list is your go-to-element. dl gets the ball rolling, similar to the ul and ol elements, establishing the list. Rather than containing li elements, though, description lists have dt elements, which are the terms, followed by dd elements, which are the descriptions associated to the dt elements. There doesn’t have to be one dt followed by one dd, there can be any number of either. For example, if there are a number of words that have the same meaning, there might be a number of dt’s followed by one dd. If you have one word that means various different things, there might be one dt followed by several dd’s. <h2>Some random glossary thing</h2> <dl> <dt>HTML</dt> <dd>Abbreviation for HyperText Markup Language - a language used to make web pages.</dd> <dt>Dog</dt> <dd>Any carnivorous animal belonging to the family Canidae.</dd> <dd>The domesticated sub-species of the family Canidae, Canis lupus familiaris.</dd> <dt>Moo juice</dt> <dt>Cat beer</dt> <dt>Milk</dt> <dd>A white liquid produced by cows and used for human consumption.</dd> </dl>
|