Note that there are some explanatory texts on larger screens.

plurals
  1. PONested list item styles (with empty container list items)
    primarykey
    data
    text
    <p>I'm trying to make the following arrangement with lists:</p> <pre><code>1. a. TextA b. TextB c. TextC 2. Text2 a. TextA </code></pre> <p>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:</p> <pre><code>1. a. TextA b. TextB c. TextC 2. Text2 a. TextA </code></pre> <p>HTML code:</p> <pre><code>&lt;ol&gt; &lt;li&gt; &lt;ol&gt; &lt;li&gt;TextA&lt;/li&gt; &lt;li&gt;TextB&lt;/li&gt; &lt;li&gt;TextC&lt;/li&gt; &lt;/ol&gt; &lt;/li&gt; &lt;li&gt;Text2 &lt;ol&gt; &lt;li&gt;TextA&lt;/li&gt; &lt;/ol&gt; &lt;/li&gt; &lt;/ol&gt; </code></pre> <p>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. </p> <p>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.</p> <p>Thanks in advance.</p> <p>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:</p> <pre><code>li { margin-bottom: .5em; margin-left: 25px; } li:before { display: inline-block; content: counter(item) "."; counter-increment: item; width: 20px; margin-left: -23px; } </code></pre> <p>The last 7 lines make the lists behave like I outlined above, sorry for the confusion!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload