Shopify themes, liquid, logos, and UX
Hello,
I have uploaded an image as the background for the top hero section of my homepage. It appears that on larger screens, the image "repeats" and you can see it start over on the left and right sides. Is there any way to have the image just stretch to fit?
#shopify-section-template--16906658938937__image_with_text_4WiMcG>div {
background-image: url(/cdn/shop/files/section_1_-_Hero_Background_1920.jpg?v=1722865849);
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
}
Hello @md249
You can add code by following these steps
1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file
3. Paste the below code before </body> on theme.liquid
<style>
#shopify-section-template--16906658938937__image_with_text_4WiMcG>div{
background-size: cover;
background-repeat: no-repeat;
background-position: center;
width: 100%;
max-width: 100%;
}
</style>
Was my reply helpful? Click Like to let me know!
Was your question answered? Mark it as an Accepted Solution.
@media screen and (min-width: 750px) {
.section-template--16906658938937__image_with_text_4WiMcG-padding {
background-size: contain !important;
}
}
Can you try add this code to last line file base.css @md249
- Please press 'Like' and mark it as 'Solution' if you find it helpful. Thank you.
If our suggestions are useful, please let us know by giving it a like or marking it as a solution.
Salepify: Efficiently increase sales conversion with sale-driven features like auto add to cart, free gifts (free plan available)
Salemate: Boost your AVO with 2-layer offer, countdown upsell in your post purchase page
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn 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, 2025