jquery - how use parent Selecltor css3 crossbrowser -
this question has answer here:
- is there css parent selector? 25 answers
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
Post a Comment