HTML Definition List

 

3. Definition List (<dl>)

A definition list is used to define terms and their descriptions.

Basic Syntax:

<dl> <dt>Term 1</dt> <dd>Description for Term 1</dd> <dt>Term 2</dt> <dd>Description for Term 2</dd> </dl>

Elements within <dl>:

  • <dt>: Represents a term.
  • <dd>: Represents the description of the term.

Example:

<dl> <dt>HTML</dt> <dd>HyperText Markup Language</dd> <dt>CSS</dt> <dd>Cascading Style Sheets</dd> </dl>

Additional Attributes for List Items (<li>)

  • value (used only in <ol>): Specifies a custom value for a list item.

Example with value:

<ol> <li value="10">Starts at 10</li> <li>11</li> </ol>

Comments

Popular posts from this blog

Introduction to Computer

History of Computer

Computer Generation