Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
9541 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Penulis

Thanks :)

Jawaban Terbai

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


Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Mei 25
11109
1
Apr 24
8941
1
Feb 23
9257
0
Okt 21
3473
3
Okt 20
5946