user94
user94

Reputation: 419

How to scale from left to right only

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 from left how can i do this

Upvotes: 11

Views: 9408

Answers (2)

Asons
Asons

Reputation: 87231

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;
}

Upvotes: 12

razemauze
razemauze

Reputation: 2676

I believe the transform-origin can be helpful here:

body {
    transform:scale(0.67);
    transform-origin:left center;
}

Upvotes: 19

Related Questions