- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML Tag
The dl element in HTML is used to define description list. In HTML5, the <dl> is used to define a description list, whereas the <dl> in HTML4 defined definition list.
Let us now see an example to implement the <dl> tag −
Example
<!DOCTYPE html> <html> <body> <h2>Sports</h2> <dl> <dt>Football</dt> <dd>It is played by 250 million players in over 200 countries.</dd> <dt>Cricket</dt> <dd>It is a bat-and-ball game played between two teams of eleven players on a field.</dd> <dt>Hockey</dt> <dd>There are many types of hockey such as bandy, field hockey, and ice hockey.</dd> <dt>Golf</dt> <dd>It is a club-and-ball sport in which players use various clubs to hit balls into a series of holes on a course in as few strokes as possible.</dd> </dl> </body> </html>
Output
In the above example, we have set the <dl> to set the description list −
<dl> <dt>Football</dt> <dd>It is played by 250 million players in over 200 countries.</dd> <dt>Cricket</dt> <dd>It is a bat-and-ball game played between two teams of eleven players on a field.</dd> <dt>Hockey</dt> <dd>There are many types of hockey such as bandy, field hockey, and ice hockey.</dd> <dt>Golf</dt> <dd>It is a club-and-ball sport in which players use various clubs to hit balls into a series of holes on a course in as few strokes as possible.</dd> </dl>
The <dt> element above defines a term in the definition list, whereas the <dd> also defines a term, but you can add links, images, line breaks inside the <dd>.
Advertisements