jquery - how use parent Selecltor css3 crossbrowser -


this question has answer here:

i select element parent .........................

i have aclass , cclass.. aclass parent , cclass child class..

 <div class="a">   <div class="c">mgmg</div> </div>  <div class="a">   <div class="c">mgmg</div> </div>  <div class="a">  </div>  <div class="a">    <div class="c">mgmg</div> </div> 

//how use parent select csscode

.a < .c{         border:1px solid red;        color:red;        background-color:green;  } 

this not possible in css alone. css can traverse down dom.

an alternative use javascript find .c elements , find parent .a, if exists.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -