#798 Posted in ‘Econa’

Latest post by Lefteris Kavadas on Monday, 29 November 2021 11:14 EET

Colin Dowling
Hi,

I need to ensure the images here are all the same height: https://www.gallerymckee.co.uk/NewSite/galleries/works-on-paper

I have used this: (max-height: 300px) 1000vh
in : Articles list views options / Sizes attribute

Can you please let me know the correct code.

Thanks

Lefteris Kavadas
Hi Colin,

The sizes attribute has nothing to do with the images height. The sizes attribute just tells the browser which size it needs to load. For example you can load small images for mobile devices and larger images for desktop devices.

Now, to answer your question.
In order to have images with the exact same height they need to have the exact same aspect ratio.
In the link you provided some of the images are square while some have a portrait orientation. This means that it's impossible to have the exact same height without stretching or cropping.
If you don't mind cropping then you can use a bit of CSS to make the images have the same height:

.j51news-image img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}


Regards

Note: An active subscription is required in order to get support for our paid extensions. For our free extensions, if you don't have an account, register and then submit your support request.  In case you just want to ask a question, you can also use the contact form .

Firecoders
Are you using our extensions? Please post a review at the Joomla extensions directory!
Post a review