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

Definition of dl, dd and dt tags in html

黄舟
Release: 2017-06-21 15:21:43
Original
9777 people have browsed it

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:
      < dl>< /dl> is used to create a normal list,
      < dt>< /dt> is used to create upper-level items in the list,
      < ; dd>< /dd> is used to create the lowest item in the list.
      < dt>< /dt> and < dd>< /dd> must be placed in < dl>< / dl> 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>
      Copy after login

      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>
      Copy after login

      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>
      Copy after login

      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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template