html - target css of parent div -
this question has answer here:
- is there css parent selector? 25 answers
say have following mark up
<div class="xxx yyy zzz"> <!-- div generated js , class names change time --> <div class="aaa"> hello </div> </div>
how can target css of parent div without knowing class name of parent div using css ?
ex: parent.aaa { background: #fff; }
it's not possible target parent of element css. nice!
you use javascript find element , add class parent, style added class:
// javascript - jquery $(".aaa").parent().addclass("parentclass"); // css .parentclass { ... styles ... }
Comments
Post a Comment