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
croganm2y ago
Hello, do you have an example?
briancross
briancross2y ago
Yep, gotta see the code. Code pen or GitHub pages or something.
snxxwyy
snxxwyy2y ago
@s2k_off try using an aspect-ratio.
#ThatGuy
#ThatGuy2y 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?