Imagine a hierarchy structured like this:
<div class="first_level">
<div class="second_level_1">
<div class="third_level_1">
<div class="fourth_level_1">
<ul><li></li><li></li></ul>
</div>
<div class="fourth_level_2">
<div class="fifth_level_1">
</div>
<div class="fifth_level_2">
<ul><li></li><li></li></ul>
</div>
</div>
</div>
</div>
<div class="second_level_2">
<ul><li></li><li></li></ul>
</div>
</div>
I have the requirement to target only those divs that contain at least one ul
element inside. For the given structure, these would be the divs named second_level_2
, fourth_level_1
, and fifth_level_2
..
What CSS selector should I use to accomplish this task?
UPDATE:
If achieving the desired outcome with CSS alone is not feasible, you can provide solutions utilizing JavaScript. However, I would greatly prefer avoiding JavaScript if possible due to the specific requirements of my code...