I have an archive that displays items in 4 columns. Obviously, I have images with different width and height. I want to display the images into a square container.
I could get the images to soft crop the width. But, how do I add the white space/margin/padding to the images so they are vertically centered nicely into a square container?
For example, see attached image, I would like the row of the 4 images to have the same height.
Hello,
I suggest you follow try CSS codes to add Vertical alignment "Top" to each column, for example, if you are using Bootstrap grid, you can try CSS class "align-top", see Bootstrap document:
hidden link
I am not sure if I am explaining my question correctly.
Right now, after cropping the images, the images are displayed aligned to the top (row.jpg). Notice the text are not aligned because the first two images have different heights from the last two images.
Is there a way to vertically center the first two images and to have the same height as the last two images so the text are also aligned nicely (desired display.jpg)?
Thanks for the details, for the screenshot you provided above.
https://toolset.com/wp-content/uploads/2019/10/1356591-desired_display.jpg
It needs custom CSS codes, for example:
in each column, you can display a HTML table with two rows:
1) the first row display the image, use CSS codes to:
- display the image as Vertical alignment "center"
- display this row as fixed height
2)the second row display the text