skip to Main Content

Html – Select class where parent is last child in

I have a simple html hierarchy: <div> <div> <div class="custom-class">whatever</div> </div> <div> <div class="custom-class">whatever</div> </div> <div> <div class="custom-class">thing i want to select</div> </div> </div> I am currently adding attributes to .custom-class but would like to add a specific attribute to…

VIEW QUESTION

CSS Has with Not issue

How can I get the .statistics-list that contains a ul with no li's to be hidden? .statistics-section { border: 2px solid red; } .statistics-section:has(ul:has(:not(li))) { display: none; } <div class="statistics-section"> <h2>Hello 1 - This should be visible</h2> <ul> <li>Item 1</li>…

VIEW QUESTION
Back To Top
Search