dl、dt、dd是什么标签

HTML中的<dl>标签和<dt><dd>标签一起使用,可以创建一个描述列表,例如:

<dl>
    <dt>Wechat</dt>
    <dd>About WeChat</dd>
    <dt>Tiktok</dt>
    <dd>About Tiktok</dd>
</dl>

其中<dt>定义需要描述的项目名称,<dd>定义描述。

展现效果为:

项目名称和描述不一定是一对一的关系,可以一个项目名称对应多条描述:

<dl>
    <dt>Wechat</dt>
    <dd>A free messaging and calling app available on iOS, Android, Windows, and MacOS.</dd>
    <dd>One of the most popular social softwares in China.</dd>
</dl>

展现效果为:

也可以多个项目名称对应一条描述:

<dl>
    <dt>Google</dt>
    <dt>Baidu</dt>
    <dd>About Google and Baidu</dd>
</dl>

展示效果为:

或者多个项目名称对应多条描述:

<dl>
    <dt>Chrome</dt>
    <dt>Edge</dt>
    <dt>safari</dt>
    <dt>Firefox</dt>
    <dd>Popular Web Browsers</dd>
    <dd>Free, cross-platform web browsers</dd>
</dl>

展示效果为:

注意:<dl>(描述列表)和<ul>(无序列表)、<ol>(有序列表)一样,都属于列表的一种,在使用上也有一定的含义,不能因为它在展现形式上存在缩进就把它当作缩进标签来使用,而忽略它的实际意义。