When looking for unique numbering styles beyond the typical list-style-type
, there are two main options:
- Remove default numbering with
list-style: none
and create numbers using counters, generated content, and the :before
pseudo-element (like in sandeep’s answer).
- Include numbers in the content, possibly generated through server-side techniques. Either remove default numbering for
ul
or avoid ul
altogether by using elements like div
or table
.
For example, a simple approach would be:
(i) What is the demand?<br>
(ii) For what segment(s)?<br>
…
To easily style the entire list, its items, and the numbers, it's recommended to use more detailed markup such as this:
<div class=ol>
<div class=li><span class=num>(i)</span> What is the demand?</div>
<div class=li><span class=num>(ii)</span> For what segment(s)?</div>
…
</div>
(While using blockquote
instead of div
as the outermost markup may improve fallback for non-CSS rendering, some may argue it leads to semantically incorrect markup.)