Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
9540 Widoki

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


Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Autor

Thanks :)

Najlepsza odpowiedź

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


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
maj 25
11104
1
kwi 24
8925
1
lut 23
9244
0
paź 21
3473
3
paź 20
5946