Hello SO,
I´m working with some complicated list structures, that need to be converted to HTML. Here is my problem:
The ordered lists do have fixed list-item values like this:
1. ...
2. ...
2a. ...
2b. ....
So my first idea was, to use the HTML-List-Elements "value" property. Like:
<ul>
<li value="2">...</li>
<li value="2a">...</li>
</ul>
But, as List-Element-Value only takes numbers it will print:
2. ...
2. ...
Is there any way to get the desired result within an <ol>
-Element? Or do I have to create my own "list" with float and margins?
EDIT: To make things clear - I can not edit or reformat these list, as they are laws. For an example have a look on: https://www.gesetze-im-internet.de/stgb/__5.html
I can not simply use a nested element in this, as this is not the way the law is written.
Edit 2: The best thing I came up with by now is to give my <li>
elements an attribute like data-li-value="2a."
and in my css do something like:
[data-li-value]::before {
content: attr(data-li-value) " ";
float: left;
margin-right: 2rem;
margin-right: .5rem;
margin-left: -.5rem;
}
While removing the default-list-style-type from the li
element...
Thanks for any idea and help! :)