Question regarding images in css

Hello everyone, how do I make an image wider but smaller height (shorter), in my design that I am working on the image is normal on mobile sizes and wider on tablet sizes
4 Replies
croganm
croganm3y ago
Hello, do you have an example?
briancross
briancross3y ago
Yep, gotta see the code. Code pen or GitHub pages or something.
snxxwyy
snxxwyy3y ago
@s2k_off try using an aspect-ratio.
#ThatGuy
#ThatGuy3y ago
You could achieve this by setting the width of the image to a percentage or vw (view width).

Did you find this page helpful?