CSS Lists

CSS Lists are used to display information in a structured and organized manner. In this tutorial, we will cover how to customize lists using Cascading Style Sheets (CSS).

Types of Lists

There are different types of lists that can be styled using CSS:

Styling Ordered Lists

Ordered lists are lists where each item is numbered sequentially. You can customize the style of ordered lists using CSS. Here's an example:


ol {
  list-style-type: upper-roman;
}

Example:

Result:
  1. Item 1
  2. Item 1
  3. Item 1

Styling Unordered Lists

Unordered lists are lists where each item is marked with a bullet point. You can customize the style of unordered lists using CSS. Here's an example:


ul {
  list-style-type: square;
}

Example:

Result:
  • Item 1
  • Item 2
  • Item 3

Styling Definition Lists

Definition lists consist of a term and a definition. You can customize the style of definition lists using CSS. Here's an example:


dl {
  margin-left: 40px;
}

dt {
  font-weight: bold;
}

dd {
  margin-left: 20px;
}

Example:

Result:
Apple
A fruit that grows on trees and is typically red or green in color.
Apple
A fruit that grows on trees and is typically red or green in color.
Apple
A fruit that grows on trees and is typically red or green in color.

Customizing lists with CSS allows you to enhance the visual presentation of your content. Experiment with different styles and see what works best for your website!