Skip Navigation

[Resolved] image cropping

This support ticket is created 5 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 5 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#1356469
row.jpg

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.

#1356557

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

#1356591
desired display.jpg
row.jpg

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)?

#1356621

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