I would like to have the following layout:
1. some data
2. some data
3. some data
i. another data
ii. another data
I use the following html:
<ol type="a">
Data
<li>some data</li>
<li>some data</li>
<li>some data:</li>
<ol type="i">
<li>another data</li>
<li>
other data,
</li>
</ol>
However, it gives a warning ol can’t be inside li. If I add another li I get following output:
<ol type="a">
Data
<li>some data</li>
<li>some data</li>
<li>some data:</li>
<li>
<ol type="i">
<li>another data</li>
<li>
other data,
</li>
</ol>
</li>
</ol>
1. some data
2. some data
3. some data
4.
i. another data
ii. another data
How to avoid the warning and still achieve the result. Thanks.
2
Answers
You should put your
ol
in the sameli
you want your list to be nested in. Here is an example:We can use the following CSS to style the list items:
This way, have a clean structure, and the CSS styling takes care of the numbering and formatting.