0

How can I use both transform's scale and translate method with css?

body{
  transform: scale(.5);
  transform: translate(-50%,0);
}

Obviously, the above css rule (the last one) overrides the previous line of rule transform: scale(.5) and it just applies translate.

So, is there any way that I can use both for an object?

Here object means the group of divs.

Bhojendra Rauniyar
  • 83,432
  • 35
  • 168
  • 231

1 Answers1

0

Put them together.

body{
  transform: scale(.5) translate(-50%,0);
}
Weafs.py
  • 22,731
  • 9
  • 56
  • 78