html - How do I change the size of an image in css -


i keep trying change size of image css adding width , height attribute. however, changes zoom of picture.

for example, have 90px 90px image. however, when change width , height, it's zoomed in version of pic instead of smaller pic.

my css is:

.image-90 {     horiz-align: center;     width: 60px;     height: 60px;     background-size: 90px 90px;     margin: 10px;     border: 1px rgb(218, 218, 218) solid;     background: #c4c4c4 no-repeat 0 0;     background-image: url('/content/images/person_noimage.png? width=90&height=90&mode=crop'); } 

here html (my image url stored in person.avitarimage):

<div class="image-90" style="background-image:url-person.avitarimage"></div> 

background-size has declared after background , background-image. i'm not sure if true in browsers, noticed in chrome , firefox, @ least. see http://jsfiddle.net/ws2qe/1/

if set 1 value, assumed width , height adjust automatically keep background in proportion.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -