Shopify themes, liquid, logos, and UX
Hi there - new to customizing my shopify store. I wanted to add a gif to my homepage, but on mobile it stretches off the page to the right making it look weird. How can I get this GIF centered and fit correctly on mobile? Any help would be appreciated!
Here's the website to view: https://humblebeehouse.com/
Solved! Go to the solution
This is an accepted solution.
Hi @HumblebeeHouse,
Simply follow these steps:
Navigate to Online Store -> Theme -> Edit code.
Search for the file "base.css"
Paste the provided code at the bottom of the file.
Save your changes.
@media screen and (max-width: 556px) {
.section-template--18388375732502__custom_liquid_4zpMha-padding img {
width: 100% !important;
height: 30vh !important;
}
}
Thank you
This is an accepted solution.
Hi @HumblebeeHouse,
Simply follow these steps:
Navigate to Online Store -> Theme -> Edit code.
Search for the file "base.css"
Paste the provided code at the bottom of the file.
Save your changes.
@media screen and (max-width: 556px) {
.section-template--18388375732502__custom_liquid_4zpMha-padding img {
width: 100% !important;
height: 30vh !important;
}
}
Thank you
You're welcome!
Quick question in a similar vein - is there a way to do this same thing without skewing a gif? I made a small chicken animation that is once again stretching the page to the left. I used the same code you pasted but changed the custom liquid identifier and it did make it fit on the page, but made the gif too small. Is it possible to just force the website to stay within normal mobile width even if the gif overextends on the right side?
Hi @HumblebeeHouse,
Please implement this code in base.css
Remove this code:
@media screen and (max-width: 556px) {
.section-template--18388375732502__custom_liquid_4zpMha-padding img {
width: 100% !important;
height: 30vh !important;
}
}
Implement this code:
@media screen and (max-width: 556px) {
section-template--18388375732502__custom_liquid_ghempA-padding img,
section-template--18388375732502__custom_liquid_4zpMha-padding img,
section-template--18388375732502__custom_liquid_KfybXr-padding img,
{
max-width: 100% !important;
margin: 0 auto !important;
}
body,html,*{
overflow-x: hidden !important;
}
}
Thank you
You're a wizard!!!! Thank you so much.
Thank you for your kind words! I'm glad I could assist.
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025