How to define a term or name in a definition list using HTML5 ?
HTML5 provides a way to specify a term and definition associated with it in a formatted way. A description list (or a definition list in older versions) provides a systematic arrangement of a term and its definition.
The following tags are used for defining a definition list:
- <DL>: This is the Definition List. It holds term and its definition as rows and data in tables
- <DT>: This is the Definition Term. It holds the term to be defined.
- <DFN>: This is the Definition Element. It holds the term being defined within the content.
- <DD>: This is the Definition or Description. It holds the definition for a given term.
The below example illustrates the creation of definition lists.
Example: This example creates a definition list with 2 terms, Machine Learning and Artificial Intelligence with their respective definitions.