Is it possible to ensure that a .child element with the class selected appears on top of other .child elements without changing the HTML structure and CSS position property of .child and .parent? It would be preferable if any changes made are limited to toggling child classes or styles, rather than modifying the parent. Here is the existing code:
.parent {
position: absolute;
}
.child {
position: relative;
}
<div>
<div>
<div class="parent">
<div class="child selected"></div>
</div>
<div class="parent">
<div class="child"></div>
</div>
</div>
</div>
Any insights on achieving this would be greatly appreciated. Thank you.