I am working with the Expanse 2.0 theme. I want to make the nav bar change based on what page its on. My nav bar is fairly simple at this point. I have Home, Contact, Products, Collections. The font colors for the nav bar is black. When I am on the product page I want the product nav link to change to a certain color say white. then when I click the home link the home nav changes to white. Can anyone help me with this?
Thanks Ryan
Hi Randkhawley21,
You could add the following piece of code to your liquid file:
- ```
This will add the "active" class to your nav link.
You can add css to your active class. For example:
```css
.active:hover {
color: white;
}
Hope this helps. If it doesn’t. Try adding a piece of your code in here so I can try and make it more specific.
I have not found a solution for this issue. Your code solution says .active:hover… What I want is when I am on the products page the word “Product” in the nav bar is a different color. and when I click on the home page the word "Home " changes to a different color. if your code solution will result in this solution can you give me a bit more step by step instructions? like which file do I add the above code to? where do I put the .active:hover code?
Thanks
Can you share the preview link to your store please? So I can take a look.