Home > Web Front-end > HTML Tutorial > How to create a definition list in HTML5?

How to create a definition list in HTML5?

WBOY
Release: 2023-08-29 20:33:06
forward
1401 people have browsed it

How to create a definition list in HTML5?

A description list (formerly a definition list) provides an organized arrangement of terms and their definitions.

The tags of the definition list are as follows: −

  • − This is a definition list. It stores terms and their definitions as a table of rows and data.

  • - This is the term used for definition. It keeps the phrase defined.

  • - This is used as a description or definition. It contains definitions of specific terms.

Use these tags,

The following are examples...

The Chinese translation of

Example

is:

Example

In the example below, we use the

,
,
tags to add definitions to our web pages.
<html>
<body>
   <h1>DEFINITIONS</h1>
   <dl>
      <dt>SGML</dt>
      <dd>The Standard Generalized Markup Language. </dd>
      <dt>HTML</dt>
      <dd>The Hypertext Markup Language.</dd>
      <dd>The Markup Language You Use To Create Web Pages.</dd>
      <dt>XML</dt>
      <dd>The Extensible Markup Language.</dd>
   </dl>
</body>
</html>
Copy after login

Output

When the above script is executed, it will display the text in two different steps: one as a phrase and one as a definition.

Example: Use div to wrap lines

In the example below, we use a div element to group name-value elements together -

<html>
<body>
   <h1>DEFINITIONS</h1>
   <dl>
      <div>
         <dt>TutorialsPoint</dt>
         <dd>Leading providers of web based tutorials on Computer Science academic subjects, Computer Languages, Management, Telecom, and other miscellaneous subjects</dd>
      </div>
      <div>
         <dt>Established in</dt>
         <dd>2006</dd>
      </div>
   </dl>
</body>
</html>
Copy after login

Output

When executing the above script, the definition list is as follows. TutorialsPoint and its definition are grouped together, and the year of establishment is grouped together.

The above is the detailed content of How to create a definition list in HTML5?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:tutorialspoint.com
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