Skip to Content
Menú
This question has been flagged
2 Respostes
9547 Vistes

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
Descartar
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
Descartar
Autor

Thanks :)

Best Answer

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


Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
de maig 25
11116
1
d’abr. 24
8990
1
de febr. 23
9306
0
d’oct. 21
3477
3
d’oct. 20
5954