Header navigation color changes for specific page

Trying to change the color of the nav menu just for the homepage in Shopify but couldn’t find any solution to it. I tried to call #MainContent(homepage) and header classes but nothing happened.

Using sense theme

Hi @a-moiz ,

You can change the background color of the header menu by following the instructions below

  1. From your Admin store, go to Online store > Themes > Click Actions > Edit code

  2. Open the Section folder, and find the header.liquid file.

  3. Find the <{% if section.settings.enable_sticky_header %}sticky-header{% else %}div{% endif %}

  4. After the {% endif %}, place the code below. Refer to image below

NOTE: Replace red to color of choice.

{% if template == "index" %}style="background-color: red"{% endif %}

  1. Make sure to click SAVE

It’s changing the background-color, all i want to is to change menu and icon color from black to white.

@a-moiz ,

Sorry I thought that is what you want

  1. From your Admin store, go to Online store > Themes > Click Actions > Edit code
  2. Open the Section folder, and find the header.liquid file.
  3. At the very top of the file, paste the code below

NOTE: Change the red to color of choice

{% if template == "index" %}

{% endif %}

Perfect, but it start messing up with my sticky header :disappointed_face: here’s the URL :https://azqikkm6d0zdsmsb-65315930369.shopifypreview.com

@a-moiz ,

If you have to be mindful on the color you are using. You can use the code below to change the background of your header

{% if template == "index" %}

{% endif %}

This code is not working as I wanted, I want the navigation menu to be black color when it scrolls down the background of the header remains the same.

Hi @a-moiz

Please replace the code provided with the code below. Same instructions. Thank you

{% if template == "index" %}

{% endif %}