HTML Lists

HTML lists are an integral part of web development, allowing developers to display data neatly. This guide will cover the types of HTML lists, their attributes, and examples of their usage.


HTML Attributes

HTML attributes provide additional information about HTML elements. For instance, the lang attribute in <html lang=”en”> specifies the language of the web page's content.

With a solid understanding of HTML lists and their attributes, you can improve the readability of content and data on your web pages.


Types of HTML Lists

HTML offers three types of lists:

  1. Unordered List: Displays items with bullets. There's no specific sequence required.
  2. Ordered List: Presents items in a numerical sequence, supporting various numbering styles.
  3. Definition List: Organizes items like a dictionary, with terms and their corresponding definitions.

1. Unordered List

Defined using the <ul> tag, unordered lists are typically displayed as bullet points. Individual items use the <li> tag.

Example:

<ul>
  <li>Pen</li>
  <li>Pencil</li>
  <li>Eraser</li>
</ul>

Output: