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
Post a Comment