HTML item list list ul, ol, li, dl, dt, dd



 HTML has three types of list lists:

  1. Unordered lists <ul>
  2. Ordered lists <ol>
  3. Definition lists <dl>

Unordered lists <ul>, <li>

The <ul> tag is used to indicate an unordered list of lists, <ul> is used as the container of the list, and <li> is used to describe the content of individual items.

for example:

<ul>
  <li>first item</li>
  <li>second item</li>
  <li>third item</li>
</ul>

The actual effect shown in the screen is as follows:

  • first item
  • second item
  • third item

Ordered lists <ol>, <li>

The <ol> tag is used to indicate an ordered list of lists, <ol> is used as a container for the list, and <li> is used to describe the content of individual items.

for example:

<ol>
  <li>first item</li>
  <li>second item</li>
  <li>third item</li>
</ol>

The actual effect shown in the screen is as follows:

  1. first item
  2. second item
  3. third item

Definition lists (definition lists) <dl>, <dt>, <dd>

The <dl> tag is used to indicate a series of special noun definitions, <dl> is used as a container for the list, and <dt> and <dd> are used to describe the content of individual items, where <dt> is used to indicate the defined noun (Definition Term), <dd> is used to indicate the description of the term (Description Detail).

for example:

<dl>
  <dt>Denim (semigloss finish)</dt>
  <dd>Ceiling</dd>
  <dt>Denim (eggshell finish)</dt>
  <dt>Evening Sky (eggshell finish)</dt>
  <dd>Layered on the walls</dd>
</dl>

The actual effect shown in the screen is as follows:

Denim (semigloss finish)
Ceiling
Denim (eggshell finish)
Evening Sky (eggshell finish)
Layered on the walls

Multi-level (nested) item lists (nested lists)

You can embed another independent list in any item content (<li>) to form a hierarchical list of lists.

for example:

<ol>
  <li>ordered item 1</li>
  <li>
    ordered item 2
    <ul>
      <li>unordered item 2-1</li>
      <li>unordered item 2-2</li>
    </ul>
  </li>
  <li>ordered item 3</li>
</ol>

The actual effect shown in the screen is as follows:

  1. ordered item 1
  2. ordered item 2
    • unordered item 2-1
    • unordered item 2-2
  3. ordered item 3

Post a Comment

0 Comments