<h2>div with parent class</h2>
<div class="parent">
<span>child</span>
<p><span>grandchild</span></p>
<div>
<p><span>great granchild</span></p>
</div>
</div>
<h2>div with second-parent class</h2>
<div class="second-parent">
<span>child</span>
<p><span>grandchild</span></p>
<div>
<p><span>great granchild</span></p>
</div>
</div>
.parent span {
color: green;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.