Sadly, there are no parent selectors in css (see this post). The easiest option would be to always target the parent when adding and removing classes. For example, add a “child-1-active” or “child-2-active” and a “active” class to the parent when a child is active.
Or, maybe I misunderstood your question. If so, please provide an example on CodePen… include any relevant HTML, CSS and any javascript please.
Author
Posts
Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘CSS’ is closed to new topics and replies.