コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
9371 ビュー

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


アバター
破棄
最善の回答

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.

アバター
破棄
著作者

Thanks :)

最善の回答

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


アバター
破棄
関連投稿 返信 ビュー 活動
1
5月 25
10421
1
4月 24
4021
1
2月 23
4074
0
10月 21
3055
3
10月 20
5491