Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css transform scale doesn't scale parent element

Tags:

html

css

I have 2 image with a link, i'm tring to scale them down to 50% of original image size, each image has a different size

if i add a back border i can see that image is correctly scaled down to half size but A tog is in original size

I'm also using bootstrap 3 in this page

.header-tit-logos a {
    display: inline-block;
}
    
.header-tit-logos img {
    -ms-transform: scale(0.5);
    -webkit-transform: scale(0.5);
    transform: scale(0.5);      
}
<div class="header-tit-logos">
<a href="http://www.mylink.com" target="_blank"><img src="static/images/img1.png" alt="img 1" width="60" height="117"></a>
<a href="http://www.mylink.com" target="_blank"><img src="static/images/img2.png" alt="img 2" width="145" height="54"></a>
</div>
like image 896
al404IT Avatar asked Oct 24 '25 10:10

al404IT


1 Answers

Comment from by @Paulie_D seems to be spot on and the simple answer I was looking for:

transform:scale() is an entirely visual effect. It does not actually change the size of the element.

like image 62
user17548216 Avatar answered Oct 26 '25 02:10

user17548216



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!