Handling thumbnails for different aspect ratios
-
This seems like something fairly straightforward, yet I can’t come across a solution.
My store has images of different sizes / aspect ratios. While I realize this may not be ideal, I need to find a solution that does not involve cropping them.
Here’s what this looks like now (300px width thumbnail width, no cropping):Note how the “add to cart” buttons, descriptions, price are not aligned due to the different image heights.
What I’d like is to center the images to the tallest one in the grid row, adding padding on top and bottom as necessary. Example here:This layout, in my humble opinion, is a good compromise. Can also limit the height to something reasonable so it doesn’t get too crazy for very tall and narrow images.
I’m 99% certain this is possible purely with CSS, with no cropping or image resizing. I just need some guidance on CSS that would be fairly robust and unlikely to break with version updates.
Would really appreciate if someone could help me out!Thanks in advance!!!
P.S. if what I’m saying doesn’t make any sense please let me know. I’d love to know how others have approached this problem.
- The topic ‘Handling thumbnails for different aspect ratios’ is closed to new replies.