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