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.. }

check problem here

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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -