Jump to content

Center Align Portfolio Grid Simple Blocks

Go to solution Solved by Beyondspace,

Recommended Posts

  • Solution
20 hours ago, bkwebsite said:

Site URL: http://www.surmountpictures.com/clients

I am trying to centre the portfolio grid blocks to create a better looking web page with an uneven amount of portfolio grid elements. I would like for the last row (since they are rows of 3) to be centred because it doesn't have enough

What CSS or coding can I add to centre align the portfolio blocks?

 

Screen Shot 2022-01-19 at 1.49.07 PM.png

Try adding to Home > Design > Custom Css

section[data-section-id="61e20593650682182d5743a1"] .grid-item {
  grid-column: span 2;
}

section[data-section-id="61e20593650682182d5743a1"] .grid-item:last-child:nth-child(3n - 2) {
  grid-column-end: 5;
}

Let me know how it works on your site

Support me by pressing 👍 if this useful for you

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio plugin
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
On 1/20/2022 at 10:07 AM, bangank36 said:

Try adding to Home > Design > Custom Css

section[data-section-id="61e20593650682182d5743a1"] .grid-item {
  grid-column: span 2;
}

section[data-section-id="61e20593650682182d5743a1"] .grid-item:last-child:nth-child(3n - 2) {
  grid-column-end: 5;
}

Let me know how it works on your site

Support me by pressing 👍 if this useful for you

Yes is worked! Thank you!

I only used:

section [data-section-id="61e20593650682182d5743a1"] .grid-item:last-child:nth-child(3n - 2) {
  grid-column-end: 3;
}

as I found the first part of the coding resized the grid items.

 

Thank you!

 

 

Link to comment
  • 7 months later...
On 9/16/2022 at 8:15 PM, Jack2406 said:

Hi, I'm having the same issue where I would like to centre align the portfolio grid blocks to create a better looking web page with an uneven amount of portfolio grid elements. I tried the above CSS but unfortunately, it didn't work.

 

Here is the link to the page https://www.nmeplastic.com/themanual

Thanks so much!

You mean center item 10?

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
12 hours ago, Jack2406 said:

Yes Item 10 labelled #TheRightBin.

Thanks!

Add to Design > Custom CSS

@media screen and (min-width:992px) {
div#gridThumbs>a:nth-child(10) {
    position: relative;
    left: calc(~"100% + 78px") !important;
}
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 4 months later...
On 2/13/2023 at 3:47 PM, hannah.dossary said:

Hey,

I also have the same question, although ideally i want the css to affect the last row, no matter how many items are in the grid. It is a page that may change often so it wouldn't be great to have to go in and edit the CSS code every time new items are added to the grid.

Site: https://uor.squarespace.com/talent (password: uor123)

 

Thanks so much

 

Add to Design > Custom CSS

@media screen and (min-width:768px) {
body#collection-6388a141e8549d5191e07363 div#gridThumbs .grid-item:nth-last-child(-n+2) {
    position: relative;
    left: calc(~"100% + 30px");
}
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

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.