#798 – Max image height.

Status: Closed - Category: Econa
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
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
 
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.

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 .

Note: Our support team is currently on vacation, so please anticipate slightly longer response times. Thank you for your understanding!

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