Solution 1 :

I guess you mean Home page.
So make simple css class like

.active {
 color: YourColor

After click set .active class to your html tag, and move on every element in each click.

Solution 2 :

Is not clear if you want to change the color of the button (like @mrpbennett and @GrigorAtaryan saids) or wanna change the background of the whole navbar.

However, the basic solution is the same. Just add classes to differentiate the layout and then define CSS rules for those classes.

If you want to change the navbar background color when you are in Home, I would add a class in the body of the page, like

<body class = "homePage">

and in your CSS something like

.homePage .navBar {
     background-color: #yourcolor;

(assuming that .navBar is the class of you navbar)

Problem :

If you’re on the home website, I want it to make a different color, so u know you are on the Home site and not on the other sites. (Talking about the navbar) so that the Home has a different color as the others than white, and when u click on contact, the home button changes to white and contact changes from white.

Didn’t get any idea how I could achieve this


Comment posted by Archit Gargi

home “website” or “webpage”!?

Comment posted by

do you mean something like an active link on a navbar, so you can display which page the user is on? –

Comment posted by Andrea_86

There’s some confusion in your question. First of all, when posting, make sure you’re question is well formed. In addition please provide some code for help other to understand you problem and give you an exaustive answer