Academic Block

Academic Block logo
HTML Tutorial

HTML Lists

Introduction to HTML List Elements

Lists are fundamental in HTML for grouping related items. Whether you need a simple bullet list or a more complex HTML nested lists setup, understanding how to use HTML list tags properly is important. Here, you will learn about every type of list in HTML, complete with HTML lists examples and HTML list code snippets. You can copy and test these codes immediately.

Image showing different types on Ordered and Unordered List in HTML.

Types of Lists in HTML

1. HTML Unordered List (<ul>)

An unordered list renders items with bullets by default. In other words, when you want a simple bullet point HTML display, you can use the <ul> tag along with <li> elements. Let’s try the example given below:

<!-- Example: Simple unordered list -->
<ul>
  <li>HTML tags list</li>
  <li>HTML list elements</li>
  <li>HTML list style</li>
</ul>
        

2. HTML Ordered List (<ol>)

Conversely, you can also create an ordered list uses numbers or letters. This HTML ordered list is perfect when sequence matters, as shown below:

<!-- Example: Simple ordered list -->
<ol>
  <li>First step</li>
  <li>Second step</li>
  <li>Third step</li>
</ol>
        

3. HTML Nested Lists

Furthermore, If you want to create a nested lists with sub–bullet points, following example is very useful. It shows how to create hierarchies or outlines in HTML list.

<!-- Example: Nested unordered list -->
<ul>
  <li>Fruits
    <ul>
      <li>Apple</li>
      <li>Banana</li>
    </ul>
  </li>
  <li>Vegetables
    <ul>
      <li>Carrot</li>
      <li>Broccoli</li>
    </ul>
  </li>
</ul>
        

4. HTML Definition List (<dl>)

In addition, you can also create HTML Definition List (<dl>) for a structured list of terms and their corresponding descriptions. It uses <dt> for each term and <dd> for its definition. HTML Definition List is ideal for glossaries, FAQs, or any content requiring clear, semantic pairing of terms and explanations.

<!-- Example: Definition list -->
<dl>
  <dt>HTML</dt>
  <dd>HyperText Markup Language</dd>
  <dt>CSS</dt>
  <dd>Cascading Style Sheets</dd>
</dl>
        

5. Custom Bullet Style List

Finally, you can change bullet types using the type attribute or inline style. This demonstrates a bullet code HTML variation.

<!-- Example: Custom bullet style -->
<ul type="square">
  <li>Square bullet</li>
  <li>Circle bullet</li>
</ul>

<ul style="list-style-type: upper-roman;">
  <li>Roman style 1</li>
  <li>Roman style 2</li>
</ul>

<ul style="list-style-type: circle;">
  <li>Disc style 1</li>
  <li>Disc style 2</li>
</ul>
        

6. Custom Marker Size and Color using CSS

Using CSS ::marker pseudo-element, you can easily customize both color and size of list markers. The example below shows how to create different styled markers in the HTML list.

<style>
  .custom-list-1 li::marker {
    color: #ff5733; 
    font-size: 2em;  
  }
  .custom-list-2 li::marker {
    color: #2ecc71; 
    font-size: 1.5em;
  }
  .custom-list-3 li::marker {
    color: #3498db;  
    font-size: 1em; 
  }
</style>

<ul class="custom-list-1">
  <li>Orange large markers</li>
  <li>List item two</li>
</ul>

<ol class="custom-list-2">
  <li>Green medium markers</li>
  <li>Numbered item</li>
</ol>

<ul class="custom-list-3">
  <li>Blue small markers</li>
  <li>Compact list item</li>
</ul>
        

Using HTML List-Style-Type to create Different Types of List Markers

We can modify the types of markers eaisly using List-Style-Type as shown in the table below. This table organizes every built-in list-style-type into clear categories like Unordered bullets, Numeric, Alphabetic, Classical/East-Asian, Syllabaries, Indic/Others, and Disclosure triangles. You can use it as a ready-made reference to pick and implement the perfect list marker for your HTML content.

CSS list-style-type Values by Category
Category Value Description
Unordered (bullet) disc Solid circle (default)
circle Hollow circle
square Solid square
none No marker
Decimal (numeric) decimal 1, 2, 3, …
decimal-leading-zero 01, 02, 03, …
Latin alphabet lower-alpha a, b, c, …
upper-alpha A, B, C, …
lower-roman i, ii, iii, …
upper-roman I, II, III, …
Classical / European lower-greek α, β, γ, …
armenian Traditional Armenian numbering
georgian Traditional Georgian numbering
hebrew Traditional Hebrew numbering
East-Asian cjk-ideographic 一, 二, 三, …
cjk-decimal 1, 2, 3, … (with CJK numerals)
cjk-earthly-branch 子, 丑, 寅, …
cjk-heavenly-stem 甲, 乙, 丙, …
Japanese syllabary hiragana あ, い, う, …
hiragana-iroha い, ろ, は, … (Iroha order)
katakana ア, イ, ウ, …
katakana-iroha イ, ロ, ハ, … (Iroha order)
Indic & other devanagari १, २, ३, …
bengali ১, ২, ৩, …
khmer ១, ២, ៣, …
lao ໑, ໒, ໓, …
thai ๑, ๒, ๓, …
tibetan ༡, ༢, ༣, …
ethiopic-halehame Traditional Ethiopic numbering
Disclosure triangles disclosure-open ▾ (open triangle)
disclosure-closed ▸ (closed triangle)

HTML List Types: Tags, Attributes, and Usage

A comprehensive overview of the main HTML list types like unordered, ordered, definition, and menu is provided in the table below. It serves as a quick reference to help you select the right list type for your website, ensuring both proper structure and accessibility across all devices.

Category
HTML List Tags
Use Cases
Accessibility Notes
Unordered List
<ul>, <li> — default bullet points; type (deprecated), CSS: list-style-type, list-style-image, list-style-position.
Bullet lists, navigation menus
Screen readers announce “list with X items”; preserve semantic <ul>/<li> rather than CSS-only lists.
Ordered List
<ol>, <li> — default decimal numbering; type, start, reversed; CSS: list-style-type, list-style-position.
Step-by-step instructions, tutorials
Assistive tech announces item numbers and total count; start and reversed are supported by screen readers.
Definition List
<dl>, <dt>, <dd> — term/description pairs; global attributes only.
Glossaries, FAQs, metadata
VoiceOver may announce as list but not support list navigation; test with target assistive technologies.
Menu List
<menu>, <li> — semantic toolbar/command list; treated as <ul> by browsers.
Toolbars, context commands
Exposed as list in accessibility tree; for interactive menus consider ARIA role="menu".
List Item
<li> — child of <ul>, <ol>, or <menu>; value (for <ol>).
Individual entries in any list
Native listitem role applied automatically; only add role="listitem" when using non‑semantic containers.
Nested Lists
Place a <ul> or <ol> inside an existing <li>; can nest arbitrarily deep.
Multi-level outlines, hierarchical menus
Screen readers handle nested lists but may read as flat if headings absent; use headings or ARIA labels to group levels.

Web Resources on HTML Lists

1. University of Hawaii – HTML Lists Tutorial
2. Carnegie Mellon University – HTML Lists
3. California State University, Northridge – HTML Tutorial – Lists
4. University of Rhode Island – Creating Lists and Indenting Text
5. MDN – HTML List Basics

Questions and Answers related to HTML Lists

+ What are HTML lists and which HTML list tags are used to create ordered and unordered lists? >

HTML lists allow web developers to group related items. The two primary types are ordered lists (<ol>) and unordered lists (<ul>). Ordered lists present items in a specific sequence, typically numbered, while unordered lists display items without a particular order, usually with bullet points. Each item within these lists is defined using the list item tag (<li>).

+ How do I create an HTML ordered list using HTML list code and HTML list elements? >

To create an ordered list in HTML, use the <ol> tag to enclose the list items. Each item is defined with the <li> tag. For example:

<ol>
    <li>First item</li>
    <li>Second item</li>
    <li>Third item</li>
</ol>

This will render a numbered list. You can also customize the numbering style using the type attribute within the <ol> tag.

+ How do I build an unordered list in HTML with bullet HTML, bullet list HTML, and bullet point HTML techniques? >

To create an unordered list with bullet points in HTML, use the <ul> tag to wrap the list items, and define each item with the <li> tag. For example:

<ul>
    <li>Item one</li>
    <li>Item two</li>
    <li>Item three</li>
</ul>

This will display a list with default bullet points. You can customize the bullet style using CSS properties like list-style-type.

+ What is an HTML nested list and how do I implement nested lists using HTML nested lists and HTML list tags? >

An HTML nested list is a list within a list, allowing for hierarchical item structures. To implement a nested list, place a new <ul> or <ol> inside an <li> of the parent list. For example:

<ul>
    <li>Parent item
        <ul>
            <li>Child item 1</li>
            <li>Child item 2</li>
        </ul>
    </li>
</ul>

This creates a parent list item with a nested child list, allowing for organized subcategories within your list.

+ How do I create a definition list in HTML, and what tags are used for a definition list in HTML? >

A definition list in HTML is created using the <dl> tag, which encloses pairs of terms and their definitions. Each term is defined with the <dt> tag, and each definition with the <dd> tag. For example:

<dl>
    <dt>HTML</dt>
    <dd>HyperText Markup Language</dd>
    <dt>CSS</dt>
    <dd>Cascading Style Sheets</dd>
</dl>

This will display terms with their corresponding definitions, useful for glossaries or explanatory content.

+ What are the three types of list elements in HTML, and how do they compare as shown in an HTML tags list? >

HTML provides three main types of lists: ordered lists (<ol>), unordered lists (<ul>), and definition lists (<dl>). Ordered lists are used for items that follow a specific sequence and are typically numbered. Unordered lists are for items without a particular order, usually displayed with bullet points. Definition lists consist of terms and their corresponding descriptions, using <dt> for terms and <dd> for descriptions. Each serves a unique purpose in structuring content on a webpage.

+ How do I use HTML list style to format an unordered list in HTML, and what are some best practices? >

To style an unordered list in HTML, you can use CSS to customize the appearance. For example, to change the bullet points to squares and add spacing, you can apply the following CSS:

ul {
    list-style-type: square;
    line-height: 1.5;
}

Best practices include using consistent styling across your site, ensuring adequate spacing for readability, and choosing bullet styles that align with your site’s design. Avoid using images or text characters like asterisks to create list effects; instead, use CSS for styling.

+ What are some HTML lists examples that illustrate the use of HTML ordered list, HTML unordered list, and HTML nested lists? >

Here are examples illustrating different types of HTML lists:

Ordered List:

<ol>
    <li>First item</li>
    <li>Second item</li>
    <li>Third item</li>
</ol>

Unordered List:

<ul>
    <li>Item one</li>
    <li>Item two</li>
    <li>Item three</li>
</ul>

Nested List:

<ul>
    <li>Parent item
        <ul>
            <li>Child item 1</li>
            <li>Child item 2</li>
        </ul>
    </li>
    <li>Another parent item</li>
</ul>

These examples demonstrate how to structure different types of lists in HTML.

+ How can I write a list of items in HTML using a comprehensive HTML lists tutorial that covers all HTML list elements? >

To write a list of items in HTML, you can use ordered lists, unordered lists, or definition lists, depending on the context. Here’s a brief overview:

Ordered List: Use the <ol> tag for a numbered list.

Unordered List: Use the <ul> tag for a bulleted list.

Definition List: Use the <dl> tag, along with <dt> for terms and <dd> for descriptions, to create a list of terms and their definitions.

+ What is the structure of lists in HTML and how do I group items in a list using HTML list code and bullet code HTML? >

In HTML, lists are structured using specific tags to group related items. There are three primary types of lists:

  • Unordered Lists (<ul>): Used to group items without a specific order, typically displayed with bullet points. Each item is wrapped in an <li> tag.
  • Ordered Lists (<ol>): Used for items that require a sequential order, typically displayed with numbers or letters. Each item is wrapped in an <li> tag.
  • Definition Lists (<dl>): Consist of terms and their corresponding definitions, using <dt> for terms and <dd> for definitions.

For example, an unordered list is created as follows:

<ul>
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
</ul>

This will render a list with bullet points preceding each item. To customize the bullet style, you can use CSS properties like list-style-type.

You can Edit the codes Here

HTML a programming Language MATLAB a programming Language PHP a programming Language C++ a programming Language