CSS selector for a div followed by another?

Hello. I'm trying to create a CSS selector that would select a div followed by another one. Take a look here: https://codepen.io/CZghost/pen/poOrYze What I'm trying to do is this: I have a div with class labelced-message, and following is a div with class labelced-note. What I want to do is to select the message div, but only if there is a note div following (not directly). The reason why I want that is I'm making a MediaWiki template. Something similar to the ~ selector, but the other way around. Instead of an element preceded by another, I want to select an element followed by another. In other words I'm trying to select an element that has a sibling following. In other words something like this: div.labelced-note < div.labelced-message.
2 Replies
CZghost
CZghostOP2y ago
Nevermind, I just realized that I could use the :only-child selector, as when the note is missing, the parent has only the message div.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server