Keep Parent Item Active when Child Element is Current Page – CSS/WordPress
-
Thank you for your timely help.
I have a WordPress menu, where I need the parent item to remain Active when the Child menu items (or pages) are active.
I can’t figure out how to make it work.
Please can someone explain the CSS i need.
I read this, but it’s not helping:
https://css-tricks.com/forums/topic/keep-parent-item-active-when-child-element-is-current-page-csswordpress/Here is my HTML
*******
<li id=”menu-item-67″ class=”menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-67″><span>CLIENTS</span>
<ul class=”sub-menu” style=”float: none; width: 12em; display: none;”>
<li id=”menu-item-20″ class=”menu-item menu-item-type-post_type menu-item-object-page menu-item-20″ style=”float: left; width: 100%; white-space: normal;”><span>The List</span>
<li id=”menu-item-19″ class=”menu-item menu-item-type-post_type menu-item-object-page menu-item-19″ style=”float: left; width: 100%; white-space: normal;”><span>What They Say</span>********
There are one parent menu “CLIENT”.
And two children “The List” and “What they say”.When the children pages are selected, I need “CLIENT ” to by styled “color:red”
Thanks for showing me how to do this.
If it helps, I’m using this theme:
https://dreamthemedesign.com/themes/u-design/portfolio/one-column-portfolio/
(notice when a child is selected, the parent is NOT style orange…I need that!)Thanks!
J.
- The topic ‘Keep Parent Item Active when Child Element is Current Page – CSS/WordPress’ is closed to new replies.