codingstuff.io
ExploreTutorialsProblemsCS Subjects
Get Started
ExploreTutorialsProblemsCS Subjects
Get Started
codingstuff.io

Master the art of building software through interactive tutorials, real-world problems, and guided projects.

Pune, Maharashtra, India

codingstuffmail@gmail.com

Product

  • Explore
  • Tutorials
  • Problems
  • CS Subjects

Company

  • About
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Sitemap

© 2026 codingstuff.io. All rights reserved.

Built with ❤️ for developers everywhere

/
/
All Tutorials
🎨

HTML & CSS

8 / 59 topics
1Introduction to HTML2HTML Elements3HTML Attributes4HTML Document Structure5HTML Text Formatting6HTML Links7HTML Images8HTML Lists9HTML Tables10HTML Forms
Tutorials/HTML & CSS/HTML Lists
🎨HTML & CSS

HTML Lists

Updated 2026-05-15
10 min read

HTML Lists

Introduction

Lists are a fundamental part of web design, used to organize information in a structured manner. In HTML, there are two main types of lists: ordered lists (<ol>) and unordered lists (<ul>). Each type serves different purposes and can be customized using CSS for enhanced presentation.

Concept

Ordered Lists

Ordered lists are used to present items in a sequence or order. They are typically numbered by default, but you can customize the numbering style with CSS. The <ol> element is used to create an ordered list, and each item within the list is defined using the <li> (list item) element.

Unordered Lists

Unordered lists are used to present items without any specific order. They are typically marked with bullets by default, but you can change the bullet style with CSS. The <ul> element is used to create an unordered list, and each item within the list is defined using the <li> (list item) element.

Examples

Creating Ordered Lists

Here's a basic example of how to create an ordered list:

HTML
1<ol>
2<li>First item</li>
3<li>Second item</li>
4<li>Third item</li>
5</ol>
Output
1. First item
2. Second item
3. Third item

Customizing Ordered Lists

You can customize the numbering style of an ordered list using the type attribute:

  • type="1": Decimal numbers (default)
  • type="A": Uppercase letters
  • type="a": Lowercase letters
  • type="I": Uppercase Roman numerals
  • type="i": Lowercase Roman numerals
HTML
1<ol type="A">
2<li>First item</li>
3<li>Second item</li>
4<li>Third item</li>
5</ol>
Output
A. First item
B. Second item
C. Third item

Creating Unordered Lists

Here's a basic example of how to create an unordered list:

HTML
1<ul>
2<li>First item</li>
3<li>Second item</li>
4<li>Third item</li>
5</ul>
Output
- First item
- Second item
- Third item

Customizing Unordered Lists

You can customize the bullet style of an unordered list using the type attribute:

  • type="disc": Solid disc (default)
  • type="circle": Hollow circle
  • type="square": Solid square
HTML
1<ul type="square">
2<li>First item</li>
3<li>Second item</li>
4<li>Third item</li>
5</ul>
Output
- First item
- Second item
- Third item

Nested Lists

Lists can be nested within each other to create a hierarchical structure. This is useful for creating multi-level menus or detailed outlines.

HTML
1<ul>
2<li>Fruits
3 <ul>
4 <li>Apple</li>
5 <li>Banana</li>
6 <li>Cherry</li>
7 </ul>
8</li>
9<li>Vegetables
10 <ul>
11 <li>Carrot</li>
12 <li>Celery</li>
13 <li>Broccoli</li>
14 </ul>
15</li>
16</ul>
Output
- Fruits
- Apple
- Banana
- Cherry
- Vegetables
- Carrot
- Celery
- Broccoli

What's Next?

In the next section, we will explore CSS Flexbox, a powerful layout module that allows you to create flexible and responsive designs. Understanding how to use Flexbox in conjunction with HTML lists can greatly enhance your web development skills.

Info

Remember, practice is key to mastering HTML and CSS. Try creating different types of lists and experimenting with their styles.


PreviousHTML ImagesNext HTML Tables

Recommended Gear

HTML ImagesHTML Tables