是p div.myclass一个有效的CSS选择器?我想选择div.myclass,但只有当它是p的后代时.
<body>
<div class="myclass">Do not select</div>
<p>
<any>...
<div class="myclass">Select this element to set background & border
<any>Other stuff may be here</any>
</div>
</any>
</p>
</div> <!-- added this after question was answered -->
</body>
Run Code Online (Sandbox Code Playgroud)