Jump to content

Make product page 3 column for desktop and 2 columns for mobile

Go to solution Solved by Web_Solutions,

Recommended Posts

Posted

Hello, I'd like a code to make my product page have 3 columns for desktop view and 2 columns for mobile view. 

I'm currently using the code below right now. It shows the 3 columns for desktop view in editor, but once I save it there's only 2 columns for both desktop view and mobile view. 

@media screen and {max-width: 767px}
.products.collection-content-wrapper .list-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    grid-column-gap: 30px;
    grid-row-gap: 0px;
    padding: 0;
}

  • Solution
Posted
33 minutes ago, Trinfluential said:

Hello, I'd like a code to make my product page have 3 columns for desktop view and 2 columns for mobile view. 

I'm currently using the code below right now. It shows the 3 columns for desktop view in editor, but once I save it there's only 2 columns for both desktop view and mobile view. 

@media screen and {max-width: 767px}
.products.collection-content-wrapper .list-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    grid-column-gap: 30px;
    grid-row-gap: 0px;
    padding: 0;
}

Remove your code and add the code below on Custom CSS panel in Website Utilities Website Tools > Custom CSS.

.products.collection-content-wrapper .list-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(~"0, 1fr")) !important;
  grid-column-gap: 30px !important;
  grid-row-gap: 30px !important;
  @media screen and (max-width: 767px) {
    grid-template-columns: repeat(2,minmax(~"0, 1fr")) !important;
    grid-row-gap: 0px !important;
  }
}

 

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

  • 7 months later...
Posted

@creedon actually when you do that, it applies also to the desktop style. There is no differenciation on the back end if you change on the desktip size it will apply the same on the mobile style.

Posted
1 hour ago, Kinreu said:

actually when you do that, it applies also to the desktop style. There is no differenciation on the back end if you change on the desktip size it will apply the same on the mobile style.

Not in my experience.

 

And we can see the CSS changing in the code.

Screenshot2024-05-01at5_13_18PM.thumb.png.efb8df731c138d864e65e9344362683a.png

Screenshot2024-05-01at5_13_38PM.thumb.png.e547aaf3de15b770f708c37f7992c34a.png

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.