Which of the following pair of tag define the heading of the list in description list?

: The Description List element

The HTML element represents a description list. The element encloses a list of groups of terms [specified using the element] and descriptions [provided by elements]. Common uses for this element are to implement a glossary or to display metadata [a list of key-value pairs].

Content categoriesPermitted contentTag omissionPermitted parentsImplicit ARIA rolePermitted ARIA rolesDOM interface
Flow content, and if the element's children include one name-value group, palpable content.

Either: Zero or more groups each consisting of one or more elements followed by one or more elements, optionally intermixed with and elements.
Or: [in WHATWG HTML, W3C HTML 5.2 and later] One or more

elements, optionally intermixed with and elements.

None, both the starting and ending tag are mandatory.
Any element that accepts flow content.
No corresponding role
group, list, none, presentation
HTMLDListElement

DL - Definition Lists

Permitted Context: %Body.Content, %flow, %block
Content 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.

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 . It is followed by an optional list header [caption] and then by term names [] and definitions []. For example:

List Header Term 1This is the definition of the first term. Term 2This is the definition of the second term.

which could be rendered as:

List Header

Term 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 elements without corresponding elements is deprecated.

Permitted Attributes for the DL Element

IDAn 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:

clear="40 en"move down until there is at least 40 en units freeclear="100 pixels"move down until there is at least 100 pixels free

The style sheet [or browser defaults] may provide default minimum widths for each class of block-like elements.

COMPACTThe presence of this attribute indicates the user agent should use reduced interitem spacing. The COMPACT attribute may also reduce the width of the left-hand [DT] column.

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:

TermThis is the first definition in compact format. TermThis is the second definition in compact format.

HTML Description List | HTML Definition List

HTML Description List or Definition List displays elements in definition form like in dictionary. The , and tags are used to define description list.

The 3 HTML description list tags are given below:

  1. tag defines the description list.
  2. tag defines data term.
  3. tag defines data definition [description].

Test it Now

Output:

HTMLis a markup languageJavais a programming language and platformJavaScriptis a scripting languageSQLis a query language

HTML Tag

Previous Complete HTML Reference Next


Example

A description list, with terms and descriptions:


Coffee
Black hot drink
Milk
White cold drink

Try it Yourself »

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 , and elements.

A definition list is the container element for DT and DD elements. The DL element should be used when you want to incorporate a definition of a term in your document, it is often used in glossaries to define many terms, it is also used in “normal” documents when the author wishes to explain a term in a more detail [Like this definition].The term currently being defined in the definition list. This element contains inline data.The definition description element contains data that describes a definition term. This data may be either inline, or it may be block level.

HTML5 Tags/Elements

The following section contains a list of HTML5 elements along with a brief description.

Video liên quan

Bài mới nhất

Chủ Đề