Shopify themes, liquid, logos, and UX
Hello! I'm working a website and I want the banner image on the home page to bleed into the header. I was able to do this with the following CSS code, but now the header is transparent on ALL pages.
.header-wrapper.color-background-1.gradient { position: absolute; width: 100%; background: transparent; color: #000; } .header-wrapper * { color: #000; }
I only want the header to be transparent on the home/landing page. What CSS should I add?
Here's the preview URL https://rt5as761kwdd4lm7-59803566217.shopifypreview.com
Solved! Go to the solution
This is an accepted solution.
Hi @nadiamejilla , First you need to remove
background: transparent;
from your style , we will only added on the home page, go to theme.liquid file and add the following code in the bottom of the file above </body> tag,
{% if template == 'index' %}
<style>
.header-wrapper.color-background-1.gradient {
background: transparent;
}
</style>
{% endif %}
This is an accepted solution.
Nevermind I was able to fix it - thank you for your help!! I pasted the following code at the bottom of the theme.liquid file (above <body> tag) to make it work.
{% if template == 'index' %}
<style>
.header-wrapper.color-background-1.gradient {
position: absolute;
width: 100%;
background: transparent;
color: #000;
}
</style>
{% endif %}
This is an accepted solution.
Hi @nadiamejilla , First you need to remove
background: transparent;
from your style , we will only added on the home page, go to theme.liquid file and add the following code in the bottom of the file above </body> tag,
{% if template == 'index' %}
<style>
.header-wrapper.color-background-1.gradient {
background: transparent;
}
</style>
{% endif %}
Hello! I deleted the code that I previously had and pasted your code in the theme.liquid file, but it didn't change anything.
I liked how the previous code appeared, but I only want it applied to the home page. Please help! Thank you
Can you send a screenshot of theme.liquid file?
This is an accepted solution.
Nevermind I was able to fix it - thank you for your help!! I pasted the following code at the bottom of the theme.liquid file (above <body> tag) to make it work.
{% if template == 'index' %}
<style>
.header-wrapper.color-background-1.gradient {
position: absolute;
width: 100%;
background: transparent;
color: #000;
}
</style>
{% endif %}
Glad I helped, so the problem that it wasn't placed above body tag, right?
Yes you're right - I had initially made a mistake and placed it below the <body> tag which is why it wasn't working initially.
Anyways, thanks for your solution!
Here is the transparent header:
Only on home page transparent header:
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024