Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Make parent link inactive when submenu item is active Reply To: Make parent link inactive when submenu item is active

#253055
Mottie
Member

Hi @neeta!

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.