Shopify themes, liquid, logos, and UX
I have added a product grid with a border but it isn't centered.
Ideally, i would like the grid to bleed out to the edge?
Is this possible?
Thanks!!
Solved! Go to the solution
This is an accepted solution.
Hey @visualess
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>
.collection .grid {
justify-content: center !important;
}
</style>
RESULT:
If I managed to help you then, don't forget to Like it and Mark it as Solution!
Best Regards,
Moeed
This is an accepted solution.
Hello @visualess
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>
.collection .grid{
justify-content: center;
}
.collection .grid--4-col-desktop .grid__item{
width: calc(26% - var(--grid-desktop-horizontal-spacing)* 3 / 4) !important;
max-width: calc(26% - var(--grid-desktop-horizontal-spacing)* 3 / 4) !important;
}
</style>
Was my reply helpful? Click Like to let me know!
Was your question answered? Mark it as an Accepted Solution.
@visualess Hey, thanks for posting here.
can you please share the link to inspect it, thanks.
4qs.uk
password: 44444
This is an accepted solution.
Hey @visualess
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>
.collection .grid {
justify-content: center !important;
}
</style>
RESULT:
If I managed to help you then, don't forget to Like it and Mark it as Solution!
Best Regards,
Moeed
Is there a way to make it so that the mobile version still stacks as a 2 product grid instead of 4?
This is an accepted solution.
Hello @visualess
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>
.collection .grid{
justify-content: center;
}
.collection .grid--4-col-desktop .grid__item{
width: calc(26% - var(--grid-desktop-horizontal-spacing)* 3 / 4) !important;
max-width: calc(26% - var(--grid-desktop-horizontal-spacing)* 3 / 4) !important;
}
</style>
Was my reply helpful? Click Like to let me know!
Was your question answered? Mark it as an Accepted Solution.
Is there a way to make it so that the mobile version still stacks as a 2 product grid instead of 4?
@visualess put this in css code :
.collection .grid {
justify-content: center;
}
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025