html - Selecting adjacent and previous siblings in CSS -


say instance have following html

<ul>   <li><a href="a">a</a></li>   <li><a href="b">b</a></li>   <li class="myclass"><a href="c">c</a></li>   <li><a href="d">d</a></li>   <li><a href="e">e</a></li> </ul> 

now can detemine next sibling li class="myclass" using following css .someclass + li {}. if wanted apply css rule previous li, possible using css rather jquery's $("#some-id").prevall() or writing javascript find this?

i'm not confident i've never heard of , searching hasn't provided solution.

thanks

nope, in css can't 'traverse' dom structure. can inherit style definitions recursively.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -