Accessing first level css menu style (ancestor?) regardless of page menu level
-
Hello there ??
I’m developing a website for a charity, and I’m looking for a little help. I’m using the twenty ten theme, and wondering how I access the first level menu ancestor, regardless of current item level level.For example, I would like to style the 1st level ancestor’s background to indicate to the user which menu the page is in. So I use-
#access ul li.current-menu-ancestor > a {background: url(‘https://127.0.0.1/wordpress/wp-content/uploads/2011/02/tab2.jpg’);}
This works fine when the current page is in the second level dropdown of the menu, however in the third (and so on) levels, it is the second level, which shows the background style.
This happens using both current-menu-ancestor > and current-menu-parent >
I hope this makes sense to people, and isn’t too unclear!
- The topic ‘Accessing first level css menu style (ancestor?) regardless of page menu level’ is closed to new replies.