Customizing Ordered List Markers: Right Parentheses for Lower-Alpha
The standard lower-alpha type for ordered lists in HTML utilizes dots ('.'), but what if you need to use right parentheses ('a)', 'b)', etc.) instead?
CSS provides a solution using counters, which allow for automatic numbering of elements. With a bit of modification, you can achieve your desired list style:
ol { counter-reset: list; } ol > li { list-style: none; } ol > li:before { content: counter(list, lower-alpha) ") "; counter-increment: list; }
In this CSS code:
By incorporating this CSS, your ordered list will have lower-alpha markers enclosed in right parentheses. Adjust the padding and other styling properties as needed to align and display the list as per your requirements.
The above is the detailed content of How Can I Use Right Parentheses as Ordered List Markers in HTML?. For more information, please follow other related articles on the PHP Chinese website!