Centering products

Centering products

a1dan
Tourist
11 1 5

My products are off-centered but when I make them full width they're absolutely massive. Hoping someone can help with a fix for this. Thank you!

a1dan_0-1732979637302.png

 

Replies 2 (2)

KetanKumar
Shopify Partner
37622 3670 12166

@a1dan 
Sorry you are facing this issue,
It would be my pleasure to help you.
Please share your site URL,
I will check out the issue and provide you with a solution here.

If helpful then please Like and Accept Solution. Partnership of your ️ Coffee Tips and my code can bring miracles.
Want to modify or custom changes on store Hire Me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing

DaisyVo
Shopify Partner
4436 492 586

Hi @a1dan 

To fix the issue where your products appear off-centered and become too large when set to full width, you can adjust the CSS in your Shopify theme. Here's how you can center the products properly without making them overly massive:

Steps to Fix the Issue

1-Access Your Theme Code:

  • Log in to your Shopify admin.
  • Go to Online Store > Themes.
  • Click Actions > Edit Code on your active theme.

2-Locate the Relevant CSS File:

  • Look for the theme.css, styles.css, or similar file in the Assets folder.

3-Add or Modify CSS:

Add the following code at the end of the CSS file:

.product-grid {

    display: flex;

    flex-wrap: wrap;

    justify-content: center;

}

 

.product-grid-item {

    max-width: 300px; /* Adjust to your preferred size */

    margin: 10px; /* Adds spacing between products */

    text-align: center;

}

 

@media (min-width: 768px) {

    .product-grid-item {

        flex: 1 1 calc(25% - 20px); /* For larger screens, 4 items per row */

    }

}

 

@media (max-width: 768px) {

    .product-grid-item {

        flex: 1 1 100%; /* Full width on smaller screens */

    }

}

 

4-Test the Changes:

  • Save the file and preview your store.
  • Check if the products are centered and their size looks appropriate on both desktop and mobile views.

5-Fine-tune if Necessary:

  • If the products still appear too large or too small, adjust the max-width and calc values in the CSS.

Screenshot Reference

The code above centers your product grid and ensures the products are a manageable size. Here's an example visualized: https://prnt.sc/XtDdXu3BXZ2_

Let me know if this works for you! If you need any other assistance, feel free to reply, and I will try my best to help.

Best regards,
Daisy

Please let us know if our reply is helpful by giving it a Like or marking it as a Solution!

Avada SEO & Image Optimizer - The #1 SEO solution