Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.
Hi

I found this CSS and it helps me highlighting current active main menu-item - also when the active page is in a dropdown. (Its CSS for WordPress with Elementor)

It works well - but I would like to have it work at bit different because right now its shows the same color on both main-menu and submenu .... can someone help me with how to make it red on the main menu and yellow on the submenu (I hope it makes sense ;-)


CSS:
/* Highlight all current-menu items up to 2 submenus (ul ul ul li... would be 3 menus) */
.elementor-nav-menu--main  ul li.current-menu-ancestor > a,
.elementor-nav-menu--dropdown  ul li.current-menu-ancestor > a,.main-navigation li.current-menu-item a, 
.elementor-nav-menu--main ul li.current-menu-item a,
.elementor-nav-menu--dropdown ul li.current-menu-item a,.main-navigation ul ul li.current-menu-item a {
  color: red!important;
}
 

Buy us a coffee!

Back
Top Bottom