Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Solved

Automatically resize the banner Dawn theme when on mobile so the ends are not cut off

David0761
Visitor
2 0 0

I was using Dawn 5.0 on my website and just updated to 8.0  When I used 5.0 the image banner would resize when going between mobile and desktop so it always looked the same. Now with 8.0 when I go to mobile the ends of the banner are cut off so you can not see the whole image and looks odd. Is there code to make this resize to fit the screen that is being used? Thank you for any help with this.

5.0.jpg

8.0.jpg

Accepted Solution (1)

StoreWatchers
Trailblazer
205 30 37

This is an accepted solution.

Hello @David0761,

 

Greetings from the Store Watchers Support Team! Happy to help you today.

 

Go to Online Store -> Actions -> Edit code. Then find theme.liquid.

 

online-store.JPG


In your theme.liquid file, please paste the code below before the </head> tag.

{% if template == 'index' %}
<style>
@media only screen and (max-width:768px){
#shopify-section-template--16708665737460__image_banner .banner{
height: 140px!important;
}
#shopify-section-template--16708665737460__image_banner .banner img{
object-fit: contain!important;
height: auto!important;
}
}
</style>
{% endif %}

Let me know if need further assistance

Regards,
Store Watchers Support Team

StoreWatchers - Automate testing for your Shopify store in seconds


If you find my reply helpful, please hit Like and Mark as Solution
Visit us: App Store | Website | FAQs

View solution in original post

Replies 3 (3)

StoreWatchers
Trailblazer
205 30 37

This is an accepted solution.

Hello @David0761,

 

Greetings from the Store Watchers Support Team! Happy to help you today.

 

Go to Online Store -> Actions -> Edit code. Then find theme.liquid.

 

online-store.JPG


In your theme.liquid file, please paste the code below before the </head> tag.

{% if template == 'index' %}
<style>
@media only screen and (max-width:768px){
#shopify-section-template--16708665737460__image_banner .banner{
height: 140px!important;
}
#shopify-section-template--16708665737460__image_banner .banner img{
object-fit: contain!important;
height: auto!important;
}
}
</style>
{% endif %}

Let me know if need further assistance

Regards,
Store Watchers Support Team

StoreWatchers - Automate testing for your Shopify store in seconds


If you find my reply helpful, please hit Like and Mark as Solution
Visit us: App Store | Website | FAQs
David0761
Visitor
2 0 0

Worked perfect! Thanks so much for the help.

 

 

JennsCrafting
Visitor
1 0 0

Hey! I've encountered the same issue but entering the code did not work. Pls help.