Home >Web Front-end >HTML Tutorial >Definition of dl, dd and dt tags in html

Definition of dl, dd and dt tags in html

黄舟
黄舟Original
2017-06-21 15:21:439866browse

When we use lists in the process of making web pages, we generally use the

    or
    tags, and rarely use the
    tags, but these three tags have an important role that cannot be ignored. After all, the Web Existing tags should be used as much as possible in the standard. Their uses are:
    is used to create a normal list,
    is used to create upper-level items in the list,
    < ; dd> is used to create the lowest item in the list.
    and must be placed in between pairs of flags.

    The following is an example:
    <html>
    <head>
    <title>一个普通列表</title>
    </head>
    <body text="blue">
    <dl>
    <dt>中国城市</dt>
    <dd>北京 </dd>
    <dd>上海 </dd>
    <dd>广州 </dd>
    <dt>美国城市</dt>
    <dd>华盛顿 </dd>
    <dd>芝加哥 </dd>
    <dd>纽约 </dd>
    </dl>
    </body>
    </html>

    We can see that the text in the middle of

    will move forward even if we do not indent it. The content in the middle of
    is automatically indented backwards.

    Generally, when we make lists, we usually only use the ul and li tags. As for DL, it is rarely used. It also belongs to the tags of the list class. The

    tag defines A definition list whose entries are created using the
    tag ("definition title") and the
    tag ("definition description").
    gives the name of the term, and the
    tag gives the definition of the term.
    <dl>
    <dt>相当于标题</dt>
    <dd>相当于标题下的小分类</dd>
    </dl>

    Maybe my words are difficult to understand, it is similar to the following directory tree:

    <dl>
    <dt>第一章基本语法:</dt>
    <dd>1.注释</dd>
    <dd>2.函数</dd>
    <dd>3.属性</dd>
    </dl>
    
    <dl>
    <dt>第二章:变量</dt>
    <dd>1.分配的变量</dd>
    <dd>2.读取的变量</dd>
    <dd>3.保留的变量</dd>
    </dl>

The above is the detailed content of Definition of dl, dd and dt tags 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