Menu color on the homepage only

Hi there,

I’m new in css and I need help please. I wanna change the text color of the menu but only on the homepage (I want it white while on other pages it must be black). I tried to add this code to style.css of the child theme but it didn’t work.

.home .main-navigation {
color: #ffffff;
}

Thanks

Hi,

You can change the menu link color on your homepage, with this Custom CSS:

.home #mainnav ul li a {
    color: #ffffff !important;
}

Please add the above CSS to your Child Theme’s style.css or in case you haven’t setup a Child Theme already, then you can also add the CSS to wp-admin -> Appearance -> Customizer -> Additional CSS so you won’t loose the changes after Theme or WordPress updates.

Please let me know how it works.

Kind Regards,
Csaba

Many thanks! It worked like magic :partying_face:

Hi,

Great! You’re most welcome! If you need help with anything else, please open a new topic.

Have a good day!

Kind Regards,
Csaba

1 Like