Horje

DESCRIPTION list - Lists - HTML
Learn
HTML - Lists - Description list
Description List

A description list (or definition list, as it was called before HTML5) can be created with the dl element. It consists of name-value groups, where the name is given in the dt element, and the value is given in the dd element.

<dl>
  <dt>name 1</dt>
  <dd>value for 1</dd>
  <dt>name 2</dt>
  <dd>value for 2</dd>
</dl>

Live demo (opens new window)

A name-value group can have more than one name and/or more than one value (which represent alternatives):

<dl>

  <dt>name 1</dt>
  <dt>name 2</dt>
  <dd>value for 1 and 2</dd>

  <dt>name 3</dt>
  <dd>value for 3</dd>
  <dd>value for 3</dd>

</dl>

Live demo (opens new window)

Syntax

  • <ol> ordered list items </ol>
  • <ul> unordered list items </ul>
  • <li> list item (ordered and not) </li>
  • <dl> description list items </dl>
  • <dt> description list title </dt>
  • <dd> description list description </dd>

Remarks

See Also

You can add a list-style-type CSS property to an <ul> tag in order to change what kind of icon is used to mark each list item, for example <ul style="list-style-type:disc">. The following list-style-types are permitted:

  • "list-style-type:disc" is the default dot.
  • "list-style-type:circle" is an unfilled circle.
  • "list-style-type:square" is a filled square.
  • "list-style-type:none" uses no mark at all.

You can also add a type attribute to an <ol> tag in order to change how numbering is done, for example <ol type="1">. The following types are permitted:

  • type="1" is the default form.
  • type="A" uses uppercase letters in alphabetical order
  • type="a" uses lowercase letters in alphabetical order
  • type="I" uses roman numerals with uppercase lettering
  • type="i" uses roman numerals with lowercase lettering
Read Article
https://develop.horje.com/learn/1434/reference