I need help getting the gaps out of my grid lines as well as extending them the full page width, I’m not sure how to really go about changing it.
Topic summary
A Shopify store owner seeks to remove gaps from product grid lines and extend them to full page width, referencing a target design example.
Initial Solution Provided:
- Custom CSS code added to theme.liquid file
- Removes padding from slider component
- Sets grid items to 25% width
- Eliminates grid gaps
Mobile Display Issue:
The initial code caused layout problems on mobile screens, showing compressed/overlapping product images.
Revised Solution:
- Updated CSS wrapped in media query (
@media screen and (min-width: 768px)) - Applies grid modifications only to desktop/tablet views (768px and above)
- Preserves mobile layout integrity
Current Status:
The user reports a new issue where grid lines still don’t extend full width on mobile and gaps remain visible. The discussion remains open with the user requesting additional assistance to resolve the mobile display problems.
Hey @MaiaMonange
Follow these Steps:
- Go to Online Store
- Edit Code
- Find theme.liquid file
- Add the following code in the bottom of the file above </ body> tag
<style>
slider-component {
padding: 0 !important;
}
.grid__item {
width: 25% !important;
max-width: 25% !important;
}
.grid {
gap: 0 !important;
}
</style>
RESULT:
If I managed to help you then a Like would be truly appreciated.
Best,
Moeed
Ah, my bad. Try this updated code with the same steps mentioned above.
<style>
@media screen and (min-width: 768px) {
slider-component {
padding: 0 !important;
}
.grid__item {
width: 25% !important;
max-width: 25% !important;
}
.grid {
gap: 0 !important;
}
}
</style>
That should fix your problem.
Best,
Moeed
thank you very much!
Thank you for your reply. I’m glad to hear that the solution worked well for you. If you require any more help, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated.


