CSS folks: other than using JS and/or manually adding extra classes, is there not some kind of CSS selector trick to apply a style to the "last *visible* child" element? Tried `:not(.hidden):last-child` but no luck.
9
1
14
My use case is a <ul> with <li> elements, some of which can be hidden (via .hidden class) depending on different app conditions. I apply a border-bottom to all <li> elements, but the "last visible one" needs the border-bottom removed.
8
1
You can instead add a border-top with the sibling-selector: <li> + <li>
2
1
14
ah ha! awesome, that worked! thanks!
1
3
What if the first one is hidden?

Oct 22, 2018 · 2:36 PM UTC