CSS property to change img shape/size | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

CSS property to change img shape/size

is there a property to change the shape/size of an img both width and height simultaneously? (so the image won't look distorted on one side)

14th Nov 2017, 2:21 AM
Jabbk
Jabbk - avatar
4 Respuestas
+ 5
Try: max-width:50%; max-height:50%; It keeps the proportions.
14th Nov 2017, 2:29 AM
John Wells
John Wells - avatar
+ 5
or just control the width and height CSS properties yourself
14th Nov 2017, 3:26 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 2
oh, ok thanks! ill try that!
14th Nov 2017, 2:32 AM
Jabbk
Jabbk - avatar
0
yes! taking the same max-width and max-height together with either width or height works! thanks
14th Nov 2017, 3:30 AM
Jabbk
Jabbk - avatar