DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk1 min

How to Create Numbered Lists With Lettered Sub-items in HTML and CSS

Nest an ordered list inside its parent list item, then use CSS to show lowercase letters for sub-items.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a nested ordered list: put a second <ol> inside the parent <li>, then style the nested list with list-style-type: lower-alpha. That produces numbered main items with lettered sub-items such as a, b and c.

Write the nested list in HTML

Keep the parent list item open around its sub-list. This makes the sub-items part of the item they explain, rather than a separate list.

As an Amazon Associate I earn from qualifying purchases.

<ol>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item
    <ol>
      <li>Third-a</li>
      <li>Third-b</li>
    </ol>
  </li>
  <li>Fourth item
    <ol>
      <li>Fourth-a</li>
      <li>Fourth-b</li>
      <li>Fourth-c</li>
    </ol>
  </li>
  <li>Fifth item</li>
</ol>

Set the marker style with CSS

Use decimal markers for the outer list and lowercase letters for nested ordered lists:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ol { list-style-type: decimal; }
ol ol { list-style-type: lower-alpha; }

The outer list displays 1, 2, 3; the nested lists display a, b, c. To use lowercase Roman numerals instead, set the nested list to lower-roman.

#1 Best Overall
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

Why nesting is the right approach

Nested lists express the relationship between a main item and its sub-items in the HTML structure. CSS then controls how each level is marked. This is easier to maintain than typing marker characters directly into the list text, especially if items are added or reordered.

The original SitePoint Forums question dates to August 4, 2011, and a follow-up thanks was posted August 10, 2011. The practical answer remains straightforward: use nested lists and style the nested level. Read the SitePoint discussion.

Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.