html - Unable to resize the image -


i using below code resize image . want resize image , not trim image ... want whole image smaller size , using below code :

<div style="background: url(image_url);"></div>

i don't want use <img> tag because cant iterate images because can't put java variable in <img src =""

<img src="<%=img%>"/> --> dosent work gives white_space error

try this:

<div style="width:200px; height:200px; background: url(image_url) no-repeat; background-size: contain;"></div> 

using css3 property:

background-size: contain; - image streched fit container without cutting off


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -