Here's a neat solution. (Honestly I surprised myself with this.) CSS has something called counters, where you can set, for example, automatic chapter numbers on each heading. A bit of modification gives you the below; You'll need to sort out padding etc yourself.

ol {
  counter-reset: list;
}
ol > li {
  list-style: none;
}
ol > li:before {
  content: counter(list, lower-alpha) ") ";
  counter-increment: list;
}
<span>custom list style type (v1):</span>
<ol>
  <li>Number 1</li>
  <li>Number 2</li>
  <li>Number 3</li>
  <li>Number 4</li>
  <li>Number 5</li>
  <li>Number 6</li>
</ol>

Works in all modern browsers and IE9+ (and possibly IE8 but may be buggy).

Update: I added child selector to prevent nested lists picking up the parent style. trejder also beings up a good point in the comments that the list item alignment is also messed up. An article on 456bereastreet has a good solution which involves absolutely positioning the counter.

ol {
    counter-reset: list;
}
ol > li {
    list-style: none;
    position: relative;
}
ol > li:before {
    counter-increment: list;
    content: counter(list, lower-alpha) ") ";
    position: absolute;
    left: -1.4em;
}
<span>custom list style type (v2):</span>
<ol>
  <li>Number 1</li>
  <li>Number 2</li>
  <li>Number 3</li>
  <li>Number 4</li>
  <li>Number 5</li>
  <li>Number 6</li>
</ol>

Here is a jsFiddle showing the result, including nested lists.

Answer from DisgruntledGoat on Stack Overflow
Top answer
1 of 9
212

Here's a neat solution. (Honestly I surprised myself with this.) CSS has something called counters, where you can set, for example, automatic chapter numbers on each heading. A bit of modification gives you the below; You'll need to sort out padding etc yourself.

ol {
  counter-reset: list;
}
ol > li {
  list-style: none;
}
ol > li:before {
  content: counter(list, lower-alpha) ") ";
  counter-increment: list;
}
<span>custom list style type (v1):</span>
<ol>
  <li>Number 1</li>
  <li>Number 2</li>
  <li>Number 3</li>
  <li>Number 4</li>
  <li>Number 5</li>
  <li>Number 6</li>
</ol>

Works in all modern browsers and IE9+ (and possibly IE8 but may be buggy).

Update: I added child selector to prevent nested lists picking up the parent style. trejder also beings up a good point in the comments that the list item alignment is also messed up. An article on 456bereastreet has a good solution which involves absolutely positioning the counter.

ol {
    counter-reset: list;
}
ol > li {
    list-style: none;
    position: relative;
}
ol > li:before {
    counter-increment: list;
    content: counter(list, lower-alpha) ") ";
    position: absolute;
    left: -1.4em;
}
<span>custom list style type (v2):</span>
<ol>
  <li>Number 1</li>
  <li>Number 2</li>
  <li>Number 3</li>
  <li>Number 4</li>
  <li>Number 5</li>
  <li>Number 6</li>
</ol>

Here is a jsFiddle showing the result, including nested lists.

2 of 9
31

More than 10 years after the original question the standard (and, to some extent, implementations) seem to have caught up.

CSS now provides ::marker pseudoclass which can be used to achieve custom list markers: MDN.

Using ::marker automatically indents li's content without any hacks. According to MDN, as of Feb 2021 it's supported in Firefox, Chrome and Edge, and partially (not for this use case) in Safari.

.container {
  width: 400px;
}

ol.custom-marker {
  counter-reset: list;
}

ol.custom-marker > li {
  list-style: none;
  counter-increment: list;
}

ol.custom-marker.parens-after.decimal > li::marker {
  content: counter(list) ")\a0";
}

ol.custom-marker.parens-around.lower-roman > li::marker {
  content: "(" counter(list, lower-roman) ")\a0";
}
<div class='container'>
  <ol class='custom-marker parens-after decimal'>
    <li>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Eu sem integer vitae justo eget magna fermentum. Quis varius quam quisque id diam.</li>
    <li>Another list here
      <ol class='custom-marker parens-around lower-roman'>
        <li>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Eu sem integer vitae justo eget magna fermentum. Quis varius quam quisque id diam.</li>
        <li>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Eu sem integer vitae justo eget magna fermentum. Quis varius quam quisque id diam.</li>
      </ol>
    </li>
    <li>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Eu sem integer vitae justo eget magna fermentum. Quis varius quam quisque id diam.</li>
  </ol>
</div>

\a0 in content is &nbsp;, since ::marker doesn't support margins or padding.

🌐
CodePen
codepen.io › geekalert › pen › OJRzeMR
Simple Ordered List with Parentheses
HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug · Learn more · Versions
🌐
Experts Exchange
experts-exchange.com › questions › 22130892 › Make-Parentheses-Around-HTML-Ordered-List-Outline-Numbers.html
Solved: Make Parentheses Around HTML Ordered List Outline Numbers | Experts Exchange
January 21, 2007 - Another way could be to use a background image with the brackets but this may be problematic. ... OK, then I put this in my css: ol {list-style-type: none;} li {list-style-type: none;} and I put this in my HTML file: <ol> <li>(1) list item one <ol> <li>(a) item one part i</li> <li>(b) item one part ii</li> <li>(c) item one part iii</li> </ol> </li> <li>(2) list item two</li> <li>(3) list item three</li> </ol> Although probably not very efficient, it does at least allow the parenthesis and allows full control over when not to use parenthesis.
🌐
Quora
quora.com › Can-we-use-brackets-around-a-listed-number-in-an-ordered-list-tag-in-HTML
Can we use brackets around a listed number in an ordered list tag in HTML? - Quora
Answer (1 of 3): Yes, you can use brackets around a listed number in an ordered list tag in HTML. You even can give brackets on both sides of a listed number. Follow both the codes given below. CODE for brackets on single side: Ordered List
🌐
Java2s
java2s.com › example › html-css › css-widget › adding-parentheses-in-html-ordered-list.html
Adding parentheses in HTML ordered list - HTML CSS CSS Widget
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> ol {<!-- w ww. jav a 2s.c o m--> list-style-type:none; } li:before { content:"(" counter(section, lower-alpha) ") "; } li { counter-increment:section; } </style> </head> <body> <ol> <li>Some text</li> <li>Some text</li> <li>Some text</li> <li>Some text</li> </ol> </body> </html>
🌐
W3Schools
w3schools.com › html › html_lists_ordered.asp
HTML Ordered Lists
The HTML <ol> tag defines an ordered list. An ordered list can be numerical or alphabetical. An ordered list starts with the <ol> tag. Each list item starts with the <li> tag. The list items will be marked with numbers by default:
🌐
The Coding Forums
thecodingforums.com › archive › archive › html
how can I obtain parentheses in an ordered list? | HTML | Coding Forums
January 8, 2007 - You cannot. but I would like to obtain this: 1) item one 2) item two · Click to expand... The best workaround is to put the numbers into the item contents and to use <ul> without bullets.
Find elsewhere
Top answer
1 of 6
26

You can achieve this with an ordered list <ol>:

ol {
    counter-reset: list;
}
ol > li {
    list-style: none;
}
ol > li:before {
    content: counter(list) ") ";
    counter-increment: list;
}
<ol>
    <li>some text</li>
    <li>some more text</li>
    <li>some further text</li>
</ol>

Sample JSFiddle

Referenced from: Ordered list (HTML) lower-alpha with right parentheses?

2 of 6
9

I know this is a little old now, but none of these solutions take into account double-digits or triple-digits or even wrapping lines of text.

*, ::after, ::before {
    box-sizing: border-box;
}

ol {
    counter-reset: list;
}

ol > li {
    list-style: none;
    position: relative;
}

ol > li:before {
    content: counter(list) ")";
    counter-increment: list;
    left: -40px;
    padding-right: 10px;
    position: absolute;
    text-align: right;
    width: 40px;
}
<ol>
    <li>Line 1</li>
    <li>Line 2 is long. Line 2 is long. Line 2 is long. Line 2 is long. Line 2 is long. Line 2 is long. Line 2 is long. Line 2 is long. Line 2 is long. Line 2 is long. Line 2 is long. Line 2 is long. Line 2 is long. Line 2 is long. Line 2 is long. Line 2 is long. </li>
    <li>Line 3 is not so long.</li>
    <li>Line 4</li>
    <li>Line 5 is long. Line 5 is long. Line 5 is long. Line 5 is long. Line 5 is long. Line 5 is long. Line 5 is long. Line 5 is long. Line 5 is long. Line 5 is long. Line 5 is long. Line 5 is long. Line 5 is long. Line 5 is long. Line 5 is long. Line 5 is long. </li>
    <li>Line 6 is not so long.</li>
    <li>Line 7</li>
    <li>Line 8 is long. Line 8 is long. Line 8 is long. Line 8 is long. Line 8 is long. Line 8 is long. Line 8 is long. Line 8 is long. </li>
    <li>Line 9 is not so long.</li>
    <li>Line 10</li>
    <li>Line 11 is long. Line 11 is long. Line 11 is long. Line 11 is long. Line 11 is long. Line 11 is long. Line 11 is long. Line 11 is long. Line 11 is long. Line 11 is long. Line 11 is long. Line 11 is long. Line 11 is long. Line 11 is long. Line 11 is long. Line 11 is long. </li>
    <li>Line 12 is not so long.</li>
</ol>
🌐
Jotform
jotform.com › answers › 3433451-the-paragraph-field-have-list-numbers-in-parentheses
The Paragraph field: Have list numbers in parentheses.
Kindly be informed that, unfortunately, it's not possible to have list numbers in parentheses in the Paragraph field. However, I've successfully escalated this as a feature request to our developers.
🌐
Webmaster World
webmasterworld.com › css › 7166.htm
Ordered List with right parenthesis? - CSS forum at WebmasterWorld - WebmasterWorld
A number with parenthesis is not one of them, although strictly speaking, all the CSS specs do is dictate the general style (number, roman numeral, letter, etc) and it's up to the browser to decide exactly how that looks.
🌐
Google Groups
groups.google.com › g › pandoc-discuss › c › GjILHGxqvqM
Ordered list with parentheses enclosing lower-case letters ...
You don't have permission to access this content · For access, try logging in If you are subscribed to this group and have noticed abuse, report abusive group
🌐
Sololearn
sololearn.com › en › Discuss › 1483187 › how-to-put-ol-type-a-to-get-the-list-tag-output-a
How to put <ol type = a > to get the list tag output (a) | Sololearn: Learn to code for FREE!
I am just beginner and start to learn with SoloLearn in 2018 itself. ... kp kalia You're welcome. This is exactly what I answered. You use 'ol' tag with 'type' attribute set to 'a', then format the list markers to use parentheses with CSS.
🌐
CodePen
codepen.io › 12centuries › pen › VwNrBZR
Simple Ordered List with Parentheses Numbers
A demonstration of the relatively new @counter-style CSS at-rule for defining custom list-style-types. In this example, an ordered list with numbers th...
🌐
Brainly
brainly.in › computer science › secondary school
html how to put brackets on both side of ordered list - Brainly.in
August 10, 2021 - Yes, you can use brackets around a listed number in an ordered list tag in HTML. You even can give brackets on both sides of a listed number. ... S = 2 + 12 + 122 + 1222+…. n terms in Qbasic using For loop​ · 1. What is the internet?
🌐
Itecnote
itecnote.com › tecnote › html-ordered-list-html-lower-alpha-with-right-parentheses
Ordered list (HTML) lower-alpha with right parentheses
Skip to content · React-native – React Native Error: “Animated.event now requires a second argument for options” · Python – keep on getting “x and y must have same first dimension, but have shapes (100,) and (1, 100)” · Java – Docker WARNING: Published ports are discarded when ...