I'm trying to make the following arrangement with lists:
1. a. TextA
b. TextB
c. TextC
2. Text2
a. TextA
Ideally I wouldn't have to make a seperate class or markup for the first case. The problem is that currently it looks like this:
1.
a. TextA
b. TextB
c. TextC
2. Text2
a. TextA
HTML code:
<ol>
<li>
<ol>
<li>TextA</li>
<li>TextB</li>
<li>TextC</li>
</ol>
</li>
<li>Text2
<ol>
<li>TextA</li>
</ol>
</li>
</ol>
Is it possible to do this with CSS? We only have to target FF3 fortunately so I was hoping for some advanced CSS selectors. However it seems that to "detect" the first case you have to see if there is any text in the first list item before the ol tag and I don't think you can do that with CSS.
I also noted that sometimes people put the nested ol below the li tag instead of inside of it, but I couldn't find any difference in the appearance.
Thanks in advance.
EDIT: I didn't mention something that has turned out to be very important to this problem. I need the numbers to align to the right instead of left. I found a solution for this on another stackoverflow question, the css I'm using is:
li {
margin-bottom: .5em;
margin-left: 25px;
}
li:before {
display: inline-block;
content: counter(item) ".";
counter-increment: item;
width: 20px;
margin-left: -23px;
}
The last 7 lines make the lists behave like I outlined above, sorry for the confusion!