html - How to use JavaScript to scale an image to fit -


i have 67x67 px image scale down 45x45 fit anchor not know how adjust it. html is:

<a class="compareprofilepic" id="compareprofilepic1" href="#">    <span id="compareprofilepicactionbtn1" class="autocenter">    </span> </a> 

my css is:

a.compareprofilepic {    height: 45px;    width: 45px;    border-radius: 50%;    float: left;    margin-right: 10px;    cursor: default !important; } 

and js is:

document.getelementbyid('compareprofilepic1').style.csstext = 'background-image: url(img/pic1.jpg)'; 

all searches led changing size of holding image, needs stay 45x45. suggestiosn on how scale image size?

thanks tips or pointers.

take here:

i used

document.getelementbyid('compareprofilepic1').style.backgroundsize = "45px 45px"; 

Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

visual studio 2010 - Connect to informix database windows form application -

android - Associate same looper with different threads -