Home >Web Front-end >Front-end Q&A >What is the difference between dl and ul in html?

What is the difference between dl and ul in html?

WBOY
WBOYOriginal
2021-12-23 14:29:597144browse

The difference between dl and ul in html: 1. The dl tag is used to define a description list; the ul tag is used to define an unordered list; 2. The dl tag is used in conjunction with the dt and dd tags to default to a hierarchical relationship. There is no hierarchical relationship between the ul tag and the li tag, which are unordered by default.

What is the difference between dl and ul in html?

The operating environment of this tutorial: Windows 10 system, HTML5 version, Dell G3 computer.

What is the difference between dl and ul in html

tag defines a description list.

tags are used together with
(defines items/names) and
(describes each item/name).

    Tag defines an unordered list.

    Use the

      tag together with the
    • tag to create an unordered list.

      The example is as follows:

      <html>
      <body>
      <h2>一个定义列表:</h2>
      <dl>
         <dt>计算机</dt>
         <dd>用来计算的仪器 ... ...</dd>
         <dt>显示器</dt>
         <dd>以视觉方式显示信息的装置 ... ...</dd>
      </dl>
      <h4>无序列表:</h4>
      <ul>
        <li>Coffee</li>
        <li>Tea</li>
        <li>Milk</li>
      </ul>
      </body>
      </html>

      Output result:

      What is the difference between dl and ul in html?

      ##Recommended tutorial: "

      html video tutorial

The above is the detailed content of What is the difference between dl and ul in html?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:What is html5 advertisingNext article:What is html5 advertising