Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Aspect ratio in gallery grid


SPHK

Question

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.

Edited by SPHK
Link to comment
  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Posted Images

1 answer to this question

Recommended Posts

  • 0
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

Create an account or sign in to comment

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


×
×
  • Create New...