Jump to content

Aspect ratio in gallery grid

Recommended Posts

Site URL: https://www.stephencheung.co/nyc

Hi,

I want to set my images to display in same ratio and same dimension in gallery grid, both vertical and horizontal images.

 

Just like the website below, showing both vertical and horizontal are in the same dimension even putting them in same grid.

http://alanschaller.com/streetphotography

 

I've do a research and can't figure out how to do that, please help. 

Thank you.

Link to comment
  • SPHK changed the title to Aspect ratio in gallery grid
  • Replies 1
  • Views 386
  • Created
  • Last Reply
On 3/28/2021 at 10:40 AM, SPHK said:

Site URL: https://www.stephencheung.co/nyc

Hi,

I want to set my images to display in same ratio and same dimension in gallery grid, both vertical and horizontal images.

 

Just like the website below, showing both vertical and horizontal are in the same dimension even putting them in same grid.

http://alanschaller.com/streetphotography

 

I've do a research and can't figure out how to do that, please help. 

Thank you.

added CSS code:

.gallery-grid-item img{
  object-fit: contain !important;
}

.gallery-grid-item {
  margin: 50px 2px;
}

.gallery-grid-item img {
  object-fit: cover;
  width: 100%;
}

and still not the result I want, anyone can help ?

 

image.thumb.png.ce46e8cdd472146e258474a4316c4c59.png

 

sample:

image.thumb.png.e01554ee830731fabf3a2cf45fb3792c.png

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.