i know I’ve done this with css in the past but i can’t remember how. I’m trying to have an image have the height/width (whichever is maximum) set to a specific length. 10em for example.
so an image of 200x500 would be width: auto; height: 10em
and an image of 500x200 would be width: 10em; height: auto

any ideas would be greatly appreciated

Follow

@foxes height: 10em; width: 10em; object-fit: contain?

@f0x hmm almost, the issue here is that it only changes how the element looks, rather then the actual size of the element, resulting in it being 10em by 10em even if the image scaling is correct

@f0x i worked out something, which is to set the height to 100% (or something there of) and just use max width and auto everything else, it looks ok

@f0x i ended up just using a grid and magic with that

Sign in to participate in the conversation
Pixietown

Small server part of the pixie.town infrastructure. Registration is closed.