CSS3 Scale - Prevent from scalling text

后端 未结 2 715
-上瘾入骨i
-上瘾入骨i 2020-12-07 04:58

So im facing an issue with some code, i have quickly written a simple example to show the effect in jsfiddle: http://jsfiddle.net/0v0syunc/

What i need to do is prev

2条回答
  •  孤街浪徒
    2020-12-07 05:49

    What you're doing seems to be a little obtuse, however given that, you need to scale your child h2 by the inverse ratio (1/1.3):

    Demo Fiddle

    .box:hover h2 {
      -webkit-transform: scale(0.769);
      -ms-transform: scale(0.769);
      transform: scale(0.769);
    }
    

    The issue being that the scale is being applied to the parent and all children, so you need to reverse it for the child to 'nullify' the effect.

提交回复
热议问题