This should be achievable with the list-style-type CSS property. Try out this code below, and see if this is working how you would like:
.name-list {
list-style-type: upper-alpha;
}
<ol class="name-list">
<li>Bill</li>
<li>Steve</li>
<li>William</li>
</ol>
Answer from Jeith on Stack OverflowOrdered lists with HTML type
How do I make an ordered list that uses letters instead of numbers?
Ordered lists with letters as markers - Meta Stack Exchange
- with ...
html - Ordered and Nested Lists (Letters and Numbers) - Stack Overflow
- which by default will order them by numbers. you can use the type="a" attribute in HTML to change it to lower case letters. Alternatively, you can change it with CSS by adding the following property: list-style-type: lower-alpha;
Videos
This should be achievable with the list-style-type CSS property. Try out this code below, and see if this is working how you would like:
.name-list {
list-style-type: upper-alpha;
}
<ol class="name-list">
<li>Bill</li>
<li>Steve</li>
<li>William</li>
</ol>
You're looking for list-style-type. Allowed values are listed here: https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-type
ul {
list-style-type: upper-alpha
}
<ul>
<li>one</li>
<li>two</li>
<li>three</li>
</ul>
The idea would be instead of
It would be ...
a.
b.
c.
Thanks!!
I wouldn't mind seeing lettered lists as well. I came here to post the same thing, prompted by my edit (edit #3) here: https://stackoverflow.com/posts/5760019/revisions
The OP attempted to use lettered lists, but the formatting was incorrect. I corrected the list formatting but had to change to numbered lists since there was no support for lettered lists.
Of course, this is fairly minor -- in this case (and in the majority of cases, I believe) the list can still be represented in a semantically correct way by using numbers or bullets instead of letters, so it's no big deal. It would be a nice option to have, though.
Stack Exchange uses the CommonMark markdown parser. It switched to that in 2020.
It uses two open-source markdown renderers, one for the browser that does previews and one for the server.
- markdown-it on the client side
- markdig on the server side.
So I imagine if you want markdown to do more you'd need to get the libraries to support that.
markdown-it can be extended using plugins so you'd need to either find one that already does what you want or write a new one.
MarkdownSharp can be extended using extensions so again you'd need to either find an existing one that does what you need or write a new one.
If you're writing something new you'd need to determine what syntax to use and ensure it doesn't conflict with existing syntax usage.
In parallel you could seek support for your new markdown feature, that could come from upvotes on this question. For comparison tables support has 929 upvotes and was eventually implemented so you'd ideally want community support at some significant fraction of that.
You need an ordered list <ol> which by default will order them by numbers.
you can use the type="a" attribute in HTML to change it to lower case letters. Alternatively, you can change it with CSS by adding the following property: list-style-type: lower-alpha;
These are the options an unordered list has:
| Sign | Type |
|---|---|
| a | lowercase letters |
| A | uppercase letters |
| i | lowercase Roman numerals |
| I | uppercase Roman numerals |
| 1 | numbers (default) |
The important thing is, that a "sub-list" must be still within the parent list point <li>
<ol type="A">
<li>1st 1st-level list item
<ol>2nd-level sublist
<li>1</li>
<li>2
<ol type="a">
<li>must be part of the 2nd main list point</li>
<li>must be part of the 2nd main list point</li>
<li>must be part of the 2nd main list point</li>
<li>must be part of the 2nd main list point</li>
</ol>
</li>
<li>for the 3rd main list point you need to add a new li</li>
</ol>
</li>
<li>2nd 1st level list-item</li>
</ol>
Ordered List Combined by numbers, lower case, and roman numerals
I had a similar situation where I needed to have full control over my ordered list.
This page needed to combine numbers, upper and lower case, and roman numerals.
I also had to control the initial number, letter, or roman numeral on independent sections.
Here is a summary of the CSS and HTML I currently use as a guideline.
ol.upper-letter {
list-style-type: upper-alpha;
}
ol.lower-letter {
list-style-type: lower-alpha;
}
ol.upper-roman-numerals {
list-style-type: upper-roman;
}
ol.lower-roman-numerals {
list-style-type: lower-roman;
}
<h4> Ordered List Combined by Numbers, Lower Case, and Roman Numerals</h4>
<ol start=โ1โ>
<li>first level</li>
<ol type='a' class='lower-letter' start='1'>
<li>second level</li>
<li>second level</li>
</ol>
<li>first level</li>
<ol type='a' class='lower-letter' start='3'>
<li>second level</li>
<ol type='i' class='lower-roman-numerals' start='1'>
<li>third level</li>
<li>third level</li>
</ol>
<li>second level</li>
</ol>
<li>first level</li>
</ol>