Home Is there a CSS parent selector?
Reply: 0

Is there a CSS parent selector?

user626
1#
user626 Published in July 23, 2018, 9:30 am

How do I select the <li> element that is a direct parent of the anchor element?

In example my CSS would be something like this:

li < a.active {
    property: value;
}

Obviously there are ways of doing this with JavaScript but I'm hoping that there is some sort of workaround that exists native to CSS Level 2.

The menu that I am trying to style is being spewed out by a CMS so I can't move the active element to the <li> element... (unless I theme the menu creation module which I'd rather not do).

Any ideas?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.474965 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO