Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

HTML5 <dl> tag


May 03, 2021 HTML5


Table of contents


Description list with items and descriptions:

<dl>
 <dt>咖啡</dt>
   <dd>黑色的热饮</dd>
 <dt>牛奶</dt>
   <dd>白色的冷饮</dd>
</dl>
Try it out . . .

Browser support

HTML5 <dl> tag HTML5 <dl> tag HTML5 <dl> tag HTML5 <dl> tag HTML5 <dl> tag

All major browsers support the hashtag.


Label definition and instructions for use

The label defines a list of descriptions.

The labels are used in cooperation with the labels of the .lt;dt> (defining the project/name) and the "lt;dd> (describing each item/name).


The difference between HTML 4.01 and HTML5

In HTML 4.01, the label defines a list of definitions.

In HTML5, the label defines a list of descriptions.


Global properties

Labels support the global properties of HTML.


The event property

The tag supports the event properties of HTML.


Attention:

Do not use this element (and do not use the .lt;ul?gt; element) to create indented content on the page. W hile this result style may seem like a problem, it's a bad practice and the semantics are not clear.

To change the amount of indentation described in the description list, use the CSS margin property.

Related articles

HTML tutorial: HTML list