soma-foreever
KPCKevin Powell - Community
•Created by soma-foreever on 1/26/2025 in #front-end
is it fine to explicitly set height: 120px for an image?
I'll watch them. thanks
24 replies
KPCKevin Powell - Community
•Created by soma-foreever on 1/26/2025 in #front-end
is it fine to explicitly set height: 120px for an image?
24 replies
KPCKevin Powell - Community
•Created by soma-foreever on 1/26/2025 in #front-end
is it fine to explicitly set height: 120px for an image?
1. should I explicitly set a height on images 2. should the explicitly set height be inso we went with the 3rd option but do you have an opinion on no.2?px
orrem
and why 3. is there a better way altogether to achieve same height cards across a grid.
24 replies
KPCKevin Powell - Community
•Created by soma-foreever on 1/26/2025 in #front-end
is it fine to explicitly set height: 120px for an image?
this does seem like a rock solid method of doing things
24 replies
KPCKevin Powell - Community
•Created by soma-foreever on 1/26/2025 in #front-end
is it fine to explicitly set height: 120px for an image?
are there any situations where would advice against using this method for setting height on images?
24 replies
KPCKevin Powell - Community
•Created by soma-foreever on 1/26/2025 in #front-end
is it fine to explicitly set height: 120px for an image?
but it's basically like implicitly setting height on images
24 replies
KPCKevin Powell - Community
•Created by soma-foreever on 1/26/2025 in #front-end
is it fine to explicitly set height: 120px for an image?
yes it works
24 replies
KPCKevin Powell - Community
•Created by soma-foreever on 1/26/2025 in #front-end
is it fine to explicitly set height: 120px for an image?
thanks. I'll check it out.
24 replies
KPCKevin Powell - Community
•Created by soma-foreever on 1/26/2025 in #front-end
is it fine to explicitly set height: 120px for an image?
The aspect-ratio CSS property allows you to define the desired width-to-height ratio of an element's box. This means that even if the parent container or viewport size changes, the browser will adjust the element's dimensions to maintain the specified width-to-height ratio. The specified aspect ratio is used in the calculation of auto sizes and some other layout functions.https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio Does this mean it's setting the height based on the width or setting the width based on the height?
24 replies