Skip to Content
Menu
This question has been flagged
2 Replies
8782 Views

Hello All,

How can I change my website home page menu color?

I have tried this below code using JS.

if (window.location.pathname == '/'){

$('.nav-link.show, .navbar-light .navbar-nav').css('color', '#fff!important');

});

but this code is not working properly.

Please help me out of the issue.

Thanks in advance.

Riddhi


Avatar
Discard
Best Answer

Hello @Riddhi,

You can use this code,

Hello @Riddhi,


You can use this code.


Add css


.home-menu{


color:#000!important;


}


Js code


$(document).ready(function(){


if (window.location.pathname == '/'){


$('.nav-link').addClass('home-menu')


}


});


Can you please mark this as a resolved if you are satisfied with my answer.

Avatar
Discard
Author

Thanks :)

Best Answer

thanks!! it works!!!, do you know the code for onhover color? =)


Avatar
Discard
Related Posts Replies Views Activity
1
Apr 24
520
1
Feb 23
1370
1
May 22
8079
0
Oct 21
2133
3
Oct 20
4072