html - List styling, CSS selectors -
i want select first child(list item) of ordered list, did using.
.ci-content ol.my-list > li:first-child{ color:green; //selected item in green.. }
can achieve same without using "my-list" class in selector?...how restrict depth of selection.
note: can have ol anywhere, not inside '.ci-content' always.
<ol class="my-list">first set <li>one</li> <li>two <ol> <li>two.one </li> <li>two.two</li> <li>two.three</li> </ol> </li> <li>three</li> <li>four</li> </ol> <br><br> <ol class="my-list">second set <li>one</li> <li>two</li> <li>three <ol> <li>three.one</li> <li>three.two</li> <ol> <li>three.two.one</li> <li>three.two.two</li> </ol> </ol> </li> <li>four</li> </ol>
Comments
Post a Comment