[ACCEPTED]-CSS selector to get deepest element of specific class in the HTML tree-css-selectors

Accepted answer
Score: 14

You can use the jQuery selector .rowsLayout:not(:has(.rowsLayout)).

However, for 6 performance reasons, this is not possible in CSS.

Your selector depends 5 on the children (or lack thereof) of the elements 4 that you target.
CSS is designed so that 3 an element's selectors can always be resolved 2 before the element's children exist; this 1 allows CSS to be applied as a document loads.

Score: 0

No.

Your options are: select them by id; add 4 a second class for those leaves, and select 3 by that class; use a javascript-based solution 2 to set the appropriate styling (possibly 1 using the second class).

More Related questions