How to scale from left to right only

后端 未结 2 1613
栀梦
栀梦 2021-01-12 19:45

This is my css code

 body
 {
  transform: scaleX(0.67);
 }

In this my entire website shrink both from right and left.but i need only scale

相关标签:
2条回答
  • 2021-01-12 20:14

    I believe the transform-origin can be helpful here:

    body {
        transform:scale(0.67);
        transform-origin:left center;
    }
    
    0 讨论(0)
  • 2021-01-12 20:26

    You add transform-origin which define from which position the transform should occur.

    Its default value is center center (50% 50%) and you need left center (0 50%)

    body
    {
      transform: scaleX(0.67);
      transform-origin: left center;
    }
    
    0 讨论(0)
提交回复
热议问题