html - target css of parent div -


this question has answer here:

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

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -