I need to apply custom styles to a list item with a nested <div>
container with a specific class.
This div is not the first child element of <li>
. I only know that it is nested somewhere inside <li>
.
I tried this option (below), and it works with <div>
, but for some reason, it doesn't work with <li>
.
ul{
display: flex;
flex-wrap: wrap;
gap: 20px
}
li > .item-wide{
color: green;
}
<ul>
<li> Some text </li>
<li> Some text </li>
<li> Some text </li>
<li> <div class="other"><div class="item-wide">Some text</div></div> </li>
<li> Some text </li>
</ul>