Jump to content

HowCarolSees

Circle Member
  • Posts

    3
  • Joined

  • Last visited

Reputation Activity

  1. Thanks
    HowCarolSees reacted to iamdavehart in Centering the gallery block images   
    The Gallery section in 7.1 layouts is using a CSS Grid when you pick "Grid: Simple" as the layout option. This lays out as you have shown above, as grid layouts are there to align rows AND columns. What you're describing is closer to a CSS flexbox layout, so we'd need to completely remove the grid rules and layout again. you can do this by adding some css. This code is targeted just at the block using a data section id, so you can put this in your custom css (or wrap it in <style></style> block and put it in a code block on your page)
    section[data-section-id="61196bdba2394134afc7692f"] .gallery-grid-wrapper { display:flex; align-items:center; justify-content: center; flex-wrap: wrap; flex-direction:row; grid-template-rows:unset !important; grid-template-columns:unset !important; grid-column-gap:unset !important; grid-row-gap:unset !important; } section[data-section-id="61196bdba2394134afc7692f"] .gallery-grid-wrapper figure { flex-basis:12%; padding:0 1.5vw 3vw 1.5vw; } @media screen and (max-width:768px) { section[data-section-id="61196bdba2394134afc7692f"] .gallery-grid-wrapper figure { flex-basis:45% } } finds the gallery and unsets its grid properties adds in properties to tell it to lay out as a flexbox and then center its content tells items within the gallery to be 12% wide. this is to put six on a row if the screen is phone or ipad-width then drop that down to two on a row the "gap" properties aren't that well supported for flexboxes in all browsers, so I've used a padding instead to space them out roughly the same as your original grid layout. it's close enough i think
×
×
  • 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.