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.

this get: enter image description here

... , want accomplish: enter image description here

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

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -