Anki Forums

Nested list CSS not working

I’m trying to format the second level of lists and I cannot make the selectors work…
Even if I just set colors the secon leve doesn work…

How can I target nested lists?
THis is the CSS i’m using:

ul, ol {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

ul li {
    color: red;
}

ul li ul li {
    color: green;
}

delete the first li i.e.:

    ul ul li {
        color: green;
    }
1 Like

Thank you for the answer. It works now in Anki

I’m wondering if this behavior is standard for css, though.

I was following This stack Overflow page suggestions, and apparently standard css should support my syntax…

You just need to use each open (unclosed) tag. The first li tag is opened an closed so it is not affected.