Hi, I want to have my image banner only in the Main Page behind the Header in desktop and Mobile as well. But on a scroll down I want it to become white again.
This is how I want it to look:
This is how it looks now:
Users are seeking to position an image banner behind the header on Shopify’s Dawn theme homepage, with the header becoming opaque/white on scroll.
Initial Solution:
</body> tag in theme.liquid, specifically targeting the index template.Common Issues Encountered:
header.header { max-width:100%; } to base.css resolves width issues.Current Status:
Hi, I want to have my image banner only in the Main Page behind the Header in desktop and Mobile as well. But on a scroll down I want it to become white again.
This is how I want it to look:
This is how it looks now:
@arutze , Please add the below line CSS and Js at theme.liquid file. just before the ending of tag.
{% if template == 'index' %}
{% endif %}
wow thank you very much @webwondersco ! just one question, If I change my background image, it will still work right?
@arutze , Yes, it’s work fine.
changing the background image will not affect the current functionality.
Hi, i would like the same thing as @arutze
Should i copy the codes that you’ve sent above or they might have change now, due to updates?
Thank you in advance.
Hi, I tried using the code, it works, and i try to modify the color, but it turns out like this, can you help me which part I should modify to make it full width?
Thanks
Hi! Just wondering if you figured out how to make it full width? I am having the same issue and increasing the width in the code doesn’t seem to help. @webwondersco
@tallowbar Could you please share your store URL? so can check and figure it out
@taylor345 Could you please share your store URL?
@Glond IF you are using the same theme then it’ll also work for your store
Thank you for this @webwondersco ! Exactly what I needed, however it is not full width and I’m trying to make it centered but it is not budging. As well as making it a sticky header Any help?
@laurynaw1 Sure could you please share your store URL and screenshot of exactly how you would like to display?
Hello! @webwondersco I would like the image to bleed all of the way through. Which we’ve accomplished with this code. But I want it to be fixed on the image banner only not scrolling down and it turns white.
and to have my menu drawer all white with the logo not the transparent with logo
(correct way)
(Wrong way)
Www.donleaux.com is my url.
Thank you!
@laurynaw1 The website is password protected. could you please share the front password as well?
@webwondersco Password: Leauxleaux
Thank you
@laurynaw1 Please add the below line of CSS at the end of your base.css file. You can find this file under assets folder of your theme.
body .header.transparent{
background-color:#ffffff;
}
Result:
@laurynaw1 So, you want to keep the header as it is as of now. You just want to make the menu drawer with full width and have white background with logo of website?
If yes, then it is like need to add some custom code to your theme to make it possible.
Thank you! It’s similar to the discount ones Brooklyn theme, but I believe I found a solution. Thank you for taking time to help.
Thank you @webwondersco Its working for me but unfortunately its not full width.. running into the same issues as people above. Any chance you could please have a look? Thank you https://hvngglb39md9yf7s-83068584245.shopifypreview.com
@curator_2 PLease add the below line of CSS code at the end of your base.css file.
header.header{
max-width:100%;
}