Search code examples
csscss-transforms

translateX and translateY on same element?


Is it possible to apply a CC translate X and Y on the same element?

If I try this the translateX is overridden by the translateY:

.something { 
  transform: translateX(-50%);
  transform: translateY(-50%);
}

Solution

  • You can do something like this

    transform:translate(-50%,-50%);