We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Change header background colour to white on hover and invert logo, icons and buttons to black

Solved

Change header background colour to white on hover and invert logo, icons and buttons to black

nothingchanges
Explorer
69 0 18

Hello Friends,

 

this is my store preview : https://yiwqh6-vk.myshopify.com/

 

I am trying to implement the following changes :

1. Keep the header transparent

2. Change header background colour to white when on hover

3. Invert the colour of buttons, icons and logo on hover

 

I'm trying to have my header react exactly the same way as this https://www.josephineanni.com/

 

This question similar to the other user that seems to be working but doesn't work on my case.

 

Does anybody know other solutions please. Your reply is very much appreciated.

Accepted Solution (1)
Dan-From-Ryviu
Shopify Partner
12073 2359 2539

This is an accepted solution.

Please add this code to theme.liquid file in Online Store > Themes > Edit code 

{% if template == 'index' %}
<style>
.header-wrapper:hover {
    background: #fff;
}
.header-wrapper:hover .header__heading-logo {
    filter: invert(1);
}
.header-wrapper:hover .header__icon .icon,
.header-wrapper:hover .list-menu span {
    color: #151515 !important;
}
</style>
{% endif %}

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

View solution in original post

Replies 27 (27)

DaisyVo
Shopify Partner
4469 501 598

Hi @nothingchanges 

 

Your store has an entry password here: (https://prnt.sc/hABsdZRkCafK). Could you please share it to me?

 

Looking forward to hearing from you soon. Thank you!

 

Best,
Daisy - Avada Support Team.

Please let us know if our reply is helpful by giving it a Like or marking it as a Solution!

Avada SEO & Image Optimizer - The #1 SEO solution
nothingchanges
Explorer
69 0 18

Sorry I just realised that. I just made it public. Thank you for the reply!

Dan-From-Ryviu
Shopify Partner
12073 2359 2539

Hi @nothingchanges 

Your store has password-protected so I cannot check and give you the code

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

nothingchanges
Explorer
69 0 18

Hi! Thank you for the reply! I have just made it public 😉

Dan-From-Ryviu
Shopify Partner
12073 2359 2539

This is an accepted solution.

Please add this code to theme.liquid file in Online Store > Themes > Edit code 

{% if template == 'index' %}
<style>
.header-wrapper:hover {
    background: #fff;
}
.header-wrapper:hover .header__heading-logo {
    filter: invert(1);
}
.header-wrapper:hover .header__icon .icon,
.header-wrapper:hover .list-menu span {
    color: #151515 !important;
}
</style>
{% endif %}

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

nothingchanges
Explorer
69 0 18

Should I paste it at the bottom of the page or any specific line?

Dan-From-Ryviu
Shopify Partner
12073 2359 2539

You can paste it after <head> tag

 

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

nothingchanges
Explorer
69 0 18

YOU ARE AN ABSOLUTE GEM! IT WORKED! Thank you so much!

By the way, I have another problem. Do you know how do I make my all my tabs to have a customized photos like this?

 

The way I have now :

Screenshot 2024-12-24 at 10.57.13 AM.png

 

 

 

 

 

 

 

 

The way I wanted : 

Screenshot 2024-12-24 at 10.56.32 AM.png

 

Dan-From-Ryviu
Shopify Partner
12073 2359 2539

Hi, please add this more code 

{%- if template.name contains 'collection' -%}
<style>
    .header-wrapper .header__icon .icon,
    .header-wrapper .list-menu span {
        color: #151515 !important;
    }
    .section-header .header-wrapper {
        background: transparent;
    }
    #MainContent {
        margin-top: -44px;
    }
    #MainContent .collection-hero {
        padding: 0;    
    }
    #MainContent .collection-hero__inner {
        max-width: 100%;
        padding: 0;
    }
    #MainContent .collection-hero--with-image .collection-hero__text-wrapper {
        padding: 0;
        position: absolute;
        top: 70%;
        left: 50%;
        z-index: 4;
        text-align: center;
        transform: translate(-50%, -70%);
    }
    #MainContent .collection-hero__image-container {
        flex: 1 0 100%;
        margin-left: 0;
        min-height: 610px;
        box-shadow: none;
        border: none;
        border-radius: 0;
    }
    @media (max-width: 749px) {
        #MainContent .collection-hero__image-container {
            min-height: 510px;
        }
    }
</style>
{%- endif -%}

Screenshot 2024-12-24 at 10.54.27.png

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

nothingchanges
Explorer
69 0 18

IT WORKED! THANK YOU! I'M GONNA BUY YOU A COFFEE!

Dan-From-Ryviu
Shopify Partner
12073 2359 2539

Thank you and  very welcome!

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

nothingchanges
Explorer
69 0 18

Sorry Dan, may i know where should I paste the code? Because after I pasted it, the tab become like this when I hover. I think I pasted at the wrong line.

Screenshot 2024-12-24 at 12.42.45 PM.png

Dan-From-Ryviu
Shopify Partner
12073 2359 2539

 

Please update the code. 

{%- if template.name contains 'collection' -%}
<style>
html .header-wrapper:hover 
html .scrolled-past-header .header-wrapper:hover {
    background: #5e6633 !important;
}
    .header-wrapper .header__icon .icon,
    .header-wrapper .list-menu span {
        color: #151515 !important;
    }
    .section-header .header-wrapper {
        background: transparent;
    }
    #MainContent {
        margin-top: -44px;
    }
    #MainContent .collection-hero {
        padding: 0;    
    }
    #MainContent .collection-hero__inner {
        max-width: 100%;
        padding: 0;
    }
    #MainContent .collection-hero--with-image .collection-hero__text-wrapper {
        padding: 0;
        position: absolute;
        top: 70%;
        left: 50%;
        z-index: 4;
        text-align: center;
        transform: translate(-50%, -70%);
    }
    #MainContent .collection-hero__image-container {
        flex: 1 0 100%;
        margin-left: 0;
        min-height: 610px;
        box-shadow: none;
        border: none;
        border-radius: 0;
    }
    @media (max-width: 749px) {
        #MainContent .collection-hero__image-container {
            min-height: 510px;
        }
    }
</style>
{%- endif -%}

 

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

nothingchanges
Explorer
69 0 18

Which line should I paste it? and should i remove the previous code?

Dan-From-Ryviu
Shopify Partner
12073 2359 2539

Keep previous code and add it right above previous code. 

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

nothingchanges
Explorer
69 0 18

It is still the same and no changes.

Dan-From-Ryviu
Shopify Partner
12073 2359 2539

Sorry, was missing one line of code. Please updated it

{%- if template.name contains 'collection' -%}
<style>
html .header-wrapper:hover {
background: #fff !important;
}
html .scrolled-past-header .header-wrapper:hover {
    background: #5e6633 !important;
}
    .header-wrapper .header__icon .icon,
    .header-wrapper .list-menu span {
        color: #151515 !important;
    }
    .section-header .header-wrapper {
        background: transparent;
    }
    #MainContent {
        margin-top: -44px;
    }
    #MainContent .collection-hero {
        padding: 0;    
    }
    #MainContent .collection-hero__inner {
        max-width: 100%;
        padding: 0;
    }
    #MainContent .collection-hero--with-image .collection-hero__text-wrapper {
        padding: 0;
        position: absolute;
        top: 70%;
        left: 50%;
        z-index: 4;
        text-align: center;
        transform: translate(-50%, -70%);
    }
    #MainContent .collection-hero__image-container {
        flex: 1 0 100%;
        margin-left: 0;
        min-height: 610px;
        box-shadow: none;
        border: none;
        border-radius: 0;
    }
    @media (max-width: 749px) {
        #MainContent .collection-hero__image-container {
            min-height: 510px;
        }
    }
</style>
{%- endif -%}

 

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

nothingchanges
Explorer
69 0 18

IT WORKED! But my logo color is not inverted colour when hover and the the tabs button is not in white colour when I don't hover at it.

 

Screenshot 2024-12-24 at 4.20.20 PM.pngScreenshot 2024-12-24 at 4.21.29 PM.png

Dan-From-Ryviu
Shopify Partner
12073 2359 2539

Update code

{%- if template.name contains 'collection' -%}
<style>
html .header-wrapper:hover {
background: #fff !important;
}
html .header-wrapper:hover .header__heading-logo {
    filter: invert(1);
}
html .scrolled-past-header .header-wrapper:hover .header__heading-logo {
    filter: invert(0);
}
html .scrolled-past-header .header-wrapper:hover {
    background: #5e6633 !important;
}
    .header-wrapper .header__icon .icon,
    .header-wrapper .list-menu span {
        color: #151515 !important;
    }
    .section-header .header-wrapper {
        background: transparent;
    }
    #MainContent {
        margin-top: -44px;
    }
    #MainContent .collection-hero {
        padding: 0;    
    }
    #MainContent .collection-hero__inner {
        max-width: 100%;
        padding: 0;
    }
    #MainContent .collection-hero--with-image .collection-hero__text-wrapper {
        padding: 0;
        position: absolute;
        top: 70%;
        left: 50%;
        z-index: 4;
        text-align: center;
        transform: translate(-50%, -70%);
    }
    #MainContent .collection-hero__image-container {
        flex: 1 0 100%;
        margin-left: 0;
        min-height: 610px;
        box-shadow: none;
        border: none;
        border-radius: 0;
    }
    @media (max-width: 749px) {
        #MainContent .collection-hero__image-container {
            min-height: 510px;
        }
    }
</style>
{%- endif -%}

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

nothingchanges
Explorer
69 0 18

THE LOGO IS NOW INVERTED COLOUR! THANK YOU! But the tabs are still dark colour not white when i don't hover.

Screenshot 2024-12-24 at 4.21.29 PM.png

Dan-From-Ryviu
Shopify Partner
12073 2359 2539

Code updated

{%- if template.name contains 'collection' -%}
<style>
html .header-wrapper:hover {
background: #fff !important;
}
html .header-wrapper:hover .header__heading-logo {
    filter: invert(1);
}
html .scrolled-past-header .header-wrapper:hover .header__heading-logo {
    filter: invert(0);
}
html .scrolled-past-header .header-wrapper:hover {
    background: #5e6633 !important;
}
    .header-wrapper .header__icon .icon,
    .header-wrapper .list-menu span {
        color: #fff !important;
    }
    html .header-wrapper:hover .header__icon .icon,
    html .header-wrapper:hover .list-menu span {
        color: #151515 !important;
    }
    .section-header .header-wrapper {
        background: transparent;
    }
    #MainContent {
        margin-top: -44px;
    }
    #MainContent .collection-hero {
        padding: 0;    
    }
    #MainContent .collection-hero__inner {
        max-width: 100%;
        padding: 0;
    }
    #MainContent .collection-hero--with-image .collection-hero__text-wrapper {
        padding: 0;
        position: absolute;
        top: 70%;
        left: 50%;
        z-index: 4;
        text-align: center;
        transform: translate(-50%, -70%);
    }
    #MainContent .collection-hero__image-container {
        flex: 1 0 100%;
        margin-left: 0;
        min-height: 610px;
        box-shadow: none;
        border: none;
        border-radius: 0;
    }
    @media (max-width: 749px) {
        #MainContent .collection-hero__image-container {
            min-height: 510px;
        }
    }
</style>
{%- endif -%}

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

Dan-From-Ryviu
Shopify Partner
12073 2359 2539

You did not remove the previous when updating the code. 

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

Dan-From-Ryviu
Shopify Partner
12073 2359 2539

I asked you not to remove the previous code for the the homepage. But you need to replace the code for collection page when I adding update code. 

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

nothingchanges
Explorer
69 0 18

okay now i understand. I will try again

nothingchanges
Explorer
69 0 18

IT WORKED! YOU ARE THE BEST! YOU'RE MY HERO! But may I ask how do I fix the issue below, when I scroll the text moves until header 

Screenshot 2024-12-24 at 5.05.55 PM.png

Dan-From-Ryviu
Shopify Partner
12073 2359 2539
{%- if template.name contains 'collection' -%}
<style>
html .header-wrapper:hover {
background: #fff !important;
}
html .header-wrapper:hover .header__heading-logo {
    filter: invert(1);
}
html .scrolled-past-header .header-wrapper:hover .header__heading-logo {
    filter: invert(0);
}
html .scrolled-past-header .header-wrapper:hover {
    background: #5e6633 !important;
}
    .header-wrapper .header__icon .icon,
    .header-wrapper .list-menu span {
        color: #fff !important;
    }
    html .header-wrapper:hover .header__icon .icon,
    html .header-wrapper:hover .list-menu span {
        color: #151515 !important;
    }
    .section-header .header-wrapper {
        background: transparent;
    }
    #MainContent {
        margin-top: -44px;
    }
    #MainContent .collection-hero {
        padding: 0;    
    }
    #MainContent .collection-hero__inner {
        max-width: 100%;
        padding: 0;
        position: relative;
    }
    #MainContent .collection-hero--with-image .collection-hero__text-wrapper {
        padding: 0;
        position: absolute;
        top: 70%;
        left: 50%;
        z-index: 4;
        text-align: center;
        transform: translate(-50%, -70%);
    }
    #MainContent .collection-hero__image-container {
        flex: 1 0 100%;
        margin-left: 0;
        min-height: 610px;
        box-shadow: none;
        border: none;
        border-radius: 0;
    }
    @media (max-width: 749px) {
        #MainContent .collection-hero__image-container {
            min-height: 510px;
        }
    }
</style>
{%- endif -%}

Code updated 

 

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

nothingchanges
Explorer
69 0 18

Hi! I just tried it but still the same and no changes.