I have to “Image with text” sections on the bottom of my homepage that i need the IMAGE to center on Desktop. It’s centered on mobile already. How could I achieve this?
Floof1
Users need help centering images in the “Image with text” section of Shopify’s Dawn theme on desktop (already centered on mobile).
Solutions provided:
</body> tagcomponent-image-with-text.css.image-with-text__grid with media query for screens min-width 767pxmax-width: 50% and margin: auto !important to center imagesOriginal poster confirmed the solution worked.
Follow-up issue: Another user (Dax-Hypebrickz) successfully centered images but now has gaps on both sides regardless of image size uploaded, seeking help to fill these gaps in desktop view.
Additional users expressed interest in the same solution. One commenter referenced a YouTube tutorial for centering collection grid links on Dawn theme images.
I have to “Image with text” sections on the bottom of my homepage that i need the IMAGE to center on Desktop. It’s centered on mobile already. How could I achieve this?
Floof1
Hi @Floofnboop ,
Glad to support you today.
You can check out my suggestion below to get your concern resolved.
Hope you find my answer helpful!
Kind & Best regards,
GemPages Support Team.
Hi [email removed]Floofnboop,
You can try this code by following these steps:
Step 1: Go to Online Store->Theme->Edit code.
Step 2: Search file component-image-with-text.css
Step 3: Paste the below code at bottom of the file → Save
@media(min-width:767px){
.image-with-text__grid .image-with-text__text-item:has(>div:empty){
display:none !important
}
.image-with-text__grid:has(.image-with-text__text-item > div:empty) .image-with-text__media-item{
max-width: 50% !important;
margin: auto !important;
}
}
Hope my solution works perfectly for you!
Best regards,
Victor | PageFly
worked, thanks!
You are welcome. I’m glad when I can help you ![]()
Hi there,
Thanks for the help; after I center the image, how can I fill this gap on this image?
There is a gap on both side, and no matter what size of the image that I upload it just have 2 gap on the size during the PC view, can you please help, thanks.
Thanks a lot
Hi @Floofnboop , check out a helpful YouTube tutorial on centering collection grid links on images in the Shopify Dawn Theme: https://www.youtube.com/watch?v=LNCzj6cxw1s.
I have the same issue. Please help