12 Replies
So instead of immediately follows, is there immediately before?
---
Reference: https://developer.mozilla.org/en-US/docs/Web/CSS/Adjacent_sibling_combinator
Unknown Userβ’3y ago
Message Not Public
Sign In & Join Server To View
Kevin recently did a video on this:
https://youtu.be/OGJvhpoE8b4
Kevin Powell
YouTube
I never thought this would be possible with CSS
The :has() pseudo-class is here, and while itβs often called the parent selector, it can actually do a lot more than that!
π Links
β
Example One: https://codepen.io/kevinpowell/pen/jOxrjvW
β
Example Two: https://codepen.io/kevinpowell/pen/dyeXxJx
β
Example Three: https://codepen.io/kevinpowell/pen/ZEopzpP
β
Example Four: https://codepen.io...
(among other uses of
:has()
)Thanks guys! @13eck @Julio_ π
indeed, the :has() pseudo-selector will do it.
just for funzies, there is a way to get ALL siblings before (not your question, i know)
Unknown Userβ’3y ago
Message Not Public
Sign In & Join Server To View
yea something like this
https://codepen.io/MarkBoots/pen/jOxKyRQ?editors=1100
Unknown Userβ’3y ago
Message Not Public
Sign In & Join Server To View
I was gonna ask, could you explain that selector in words but @Julio_ worded it nicely
So this is the starting point where we say "except"?
Unknown Userβ’3y ago
Message Not Public
Sign In & Join Server To View