Nearby lessons

14 of 19

🎨 CSS Lists

📌 What are CSS Lists?

CSS allows you to customize the appearance of HTML lists to match your website design.

Lists are commonly used for navigation, tasks, menus, and more. With CSS, you can style:

  • 🔸 Bullet shapes (disc, circle, square)
  • 🔸 List item spacing and alignment
  • 🔸 Custom icons or emojis
  • 🔸 Remove default bullets

🔹 Default Unordered List Style

By default, unordered lists (<ul>) use a disc bullet.
Code Example
PREVIEW READY
Loading Editor...
Live Preview

🔹 Circle Style List

You can change the bullet style using list-style-type: circle;.
Code Example
PREVIEW READY
Loading Editor...
Live Preview

📏 Margin Shorthand (All sides)

The margin property sets all four margins using one value.

Code Example
PREVIEW READY
Loading Editor...
Live Preview

🔄 Individual Margins

You can set margin-top, margin-right, margin-bottom, and margin-left separately for more control.

Code Example
PREVIEW READY
Loading Editor...
Live Preview

↕️ Margin - Two Values

The margin property can take two values: vertical (top & bottom) and horizontal (left & right).

Code Example
PREVIEW READY
Loading Editor...
Live Preview

🧭 Margin - Three Values

With three values: first is top, second is left & right, third is bottom.

Code Example
PREVIEW READY
Loading Editor...
Live Preview

🧭 Margin - Four Values

Four values are applied in clockwise order: top, right, bottom, left.

Code Example
PREVIEW READY
Loading Editor...
Live Preview

🎯 Margin Auto

Use margin: auto; to center block elements horizontally (requires fixed width).

Code Example
PREVIEW READY
Loading Editor...
Live Preview

🔹 Decimal Ordered List

Ordered lists (<ol>) by default use numbers.
Code Example
PREVIEW READY
Loading Editor...
Live Preview

🔹 Upper Alpha Ordered List

Use list-style-type: upper-alpha; to use capital letters.
Code Example
PREVIEW READY
Loading Editor...
Live Preview

🔹 Lower Roman Ordered List

Use list-style-type: lower-roman; for roman numerals.
Code Example
PREVIEW READY
Loading Editor...
Live Preview

🔹 Custom Icon List (Emoji)

You can remove default bullets and use emojis or custom icons instead.
Code Example
PREVIEW READY
Loading Editor...
Live Preview

🔹 Nested Lists

Lists can be nested inside each other to show sub-categories or steps.
Code Example
PREVIEW READY
Loading Editor...
Live Preview

💡 CSS List Styling Tips

  • ✅ Use list-style-type to change bullets or numbering
  • ✅ Use padding-left to adjust indent spacing
  • ✅ Use list-style: none to remove bullets
  • ✅ Combine emojis or images for custom bullets
  • ✅ Keep lists clean and accessible
  • ✅ Nest lists carefully to avoid confusion

🧠 Test Your Knowledge

5 Questions

Progress: 0 / 5
Keep Going!CSS - Display