Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
In collections when I click a product, the banner on mobile device is cut off. I have tried a few codes listed in the discussions but none are work. I am using dawn theme.
TIA
Thehandmadebar.com
Hello @Thehandmadebar,
Greetings from the Store Watchers Support Team! Happy to help you today.
Go to Online Store -> Actions -> Edit code. Then find theme.liquid.
In your theme.liquid file, please paste the code below before the </head> tag.
{% if template == 'collection' %}
<style>
@media only screen and (max-width:768px){
.banner{
height: 185px!important;
}
.banner img{
object-fit: contain!important;
height: auto!important;
}
}
</style>
{% endif %}
Let me know if need further assistance
Regards,
Store Watchers Support Team
i dont see </head> in the liquid file. the only one i see is <head>
i have attached photo
you can paste my code to line 34
Hi @Thehandmadebar,
You can try this code by following these steps:
Step 1: Go to Online Store->Theme->Edit code.
Step 2: Search file theme.liquid.
Step 3: Paste the below code at before </head> of the file -> Save
{% if template contains "product" %}
<style>
@media(max-width:767px){
.banner__media.media,.banner__media.media img{
position:static !important
}
.banner__media.media ~ .banner__content{display:none !important}
}
</style>
{% endif %}
Hope my solution works perfectly for you!
Best regards,
Victor | PageFly
the code didnt work…The above pic is in landscape mode not portrait.
I hope you are doing good and welcome to the Shopify Community!
I am Santanu from MS Web Designer (Top Rated Shopify Certified Experts and eCommerce Consultant from Singapore).
Please add this css in your bottom of the css file:
@media screen and (max-width: 749px) {
.banner__media.media {background-color: #fff !important;}
.banner__media.media img {object-fit: none !important; object-position: top center !important;}
}
@media screen and (max-width: 649px) {
.banner {height: 272px !important;}
}
@media screen and (max-width: 549px) {
.banner {height: 222px !important;}
}
@media screen and (max-width: 449px) {
.banner {height: 172px !important;}
}
@media screen and (max-width: 342px) {
.banner {height: 149px !important;}
}
Regards,
Santanu
If it’s helpful to you, please mark it as a solution.
Need Help with Shopify Design, Migration, Speed, or Custom tasks?
email: hi@mswebdesigner.com
Try Our Conversion Booster app to get more sales | Connect Our Founder Linkedin
thank you, that worked for my collections page now all others are cropped
thank you, that code worked for the collection page on mobile device. Now home paage is spaced and banner is shrunk. see above image
Yeah, i am facing the same issue from last 1 week
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024