HTML

HTML Lists tag


6. Lists Tags:

  • <ul>: Represents an unordered list.
  • <ol>: Represents an ordered list.
  • <li>: Represents a list item within <ul> or <ol>.
  • <dl>: Represents a definition list.
  • <dt>: Represents a term or name in a definition list.
  • <dd>: Represents the description or value in a definition list.

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>List Example</title>
</head>
<body>

<!-- Unordered List Example -->
<h2>Unordered List</h2>
<ul>
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
</ul>

<!-- Ordered List Example -->
<h2>Ordered List</h2>
<ol>
    <li>First item</li>
    <li>Second item</li>
    <li>Third item</li>
</ol>

<!-- Definition List Example -->
<h2>Definition List</h2>
<dl>
    <dt>Term 1</dt>
    <dd>Description for Term 1</dd>
    
    <dt>Term 2</dt>
    <dd>Description for Term 2</dd>
    
    <dt>Term 3</dt>
    <dd>Description for Term 3</dd>
</dl>

</body>
</html>