CHAPTER 18
CSS Lists
Learn how to style ordered and unordered HTML lists using CSS.
01. What is CSS Lists?
HTML lists are used to display groups of related items.
CSS can change list markers, spacing and positioning.
Lists are commonly used in navigation menus and feature sections.
02. Syntax
ul {
list-style-type: value;
}
ol {
list-style-type: value;
}
03. Example
CSS / HTML Example
AIFA Coding Lab
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: square;
padding: 20px;
}
ol {
list-style-type: upper-roman;
}
li {
margin-bottom: 10px;
}
</style>
</head>
<body>
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>
<ol>
<li>Beginner</li>
<li>Intermediate</li>
<li>Advanced</li>
</ol>
</body>
</html>
04. Important Points
✓
list-style-type controls the marker style.
✓
list-style-position controls marker placement.
✓
list-style-image can use an image as a marker.
✓
Lists can be converted into navigation menus.
05. Common Mistakes
⚠
Removing list markers without considering usability.
⚠
Using excessive indentation.
⚠
Creating navigation without proper semantic HTML.
06. Real World Use
Lists are used for menus, course lists, features, services, FAQs and navigation systems.
Ready to Practice? 🚀
Open the AIFA CSS Editor and practice this chapter live.
Try It Yourself →
Practice Exercise
Create a Course List
Create a list containing five AIFA courses and style the list with custom spacing and markers.