Gapless grid lines/full page grid lines?

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.

Summarized with AI on October 26. AI used: claude-sonnet-4-5-20250929.

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.

Gridlines I’m trying to get

My current grid lines

1 Like

Hey @MaiaMonange

Follow these Steps:

  1. Go to Online Store
  2. Edit Code
  3. Find theme.liquid file
  4. 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

1 Like

is there a way to fix it on a media screen? I get this when i put the code in

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

1 Like

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.

1 Like

Hey moeed I’m having another problem if you have time, the lines arent stretching the full screen width and they still have gaps in them on mobile, I tried adjusting the code and I couldn’t get it figured out, if you could check it out it’d be greatly appreciated!