html - adjust image to fixed content -
i'm dealing img tags have fixed width & height.
the question have set of images each 1 has own dimensions, in resulting view, of them vary in height keeping width constant.
is there way whatever image loaded in img tag keep proportions , same height?
you can use css , set property of width , height ever want
img { width : 150px; height : 150px; }
<img src="https://static.pexels.com/photos/57825/pexels-photo-57825.jpeg" alt="no image available" /> <img src="https://static.pexels.com/photos/149941/pexels-photo-149941.jpeg" alt="no image available" /> <img src="https://static.pexels.com/photos/163145/laptop-computer-coffee-yellow-163145.jpeg" alt="no image available" /> <img src="https://static.pexels.com/photos/7107/notebook-hero-workspace-minimal.jpg" alt="no image available" />
Comments
Post a Comment