CodesJava

Easy learning with example program codes

Description List in HTML

HTML Description List

In HTML Description list, entries are listed like a dictionary or encyclopedia, and hence it is also called as a Definition List. To display a glossary, a list of terms or other name-value lists, theĀ  HTML Description list can be the best choice.

There are three tags used in an HTML Description list. These are:

  • <dl>: To define the description list.
  • <dt>: To define the data term.
  • <dd>: To define the data definition or description.

Example:

<!DOCTYPE html>
<html>
<body>
<h2>HTML Description List or Definition List</h2>
<dl>
  <dt><b>HTML</b></dt>
  <dd>- Hyper Text Markup Language</dd>
  <dt><b>HTTP</b></dt>
  <dd>- Hyper Text Transfer Protocol</dd>
</dl>
</body>
</html>

Output:




HTML Description List or Definition List

HTML
- Hyper Text Markup Language
HTTP
- Hyper Text Transfer Protocol

Explanation:
In the above example, we created a description or definition list in HTML containing two items along with their definitions.

Please follow and like us:
error
Posted in HTML   









Copyright © 2019 CodesJava DMCA.com Protection Status