Skip to content

Instantly share code, notes, and snippets.

@alvinwan
Created February 21, 2019 18:06
Show Gist options
  • Save alvinwan/2ca4394f6b79848588aec9845001d749 to your computer and use it in GitHub Desktop.
Save alvinwan/2ca4394f6b79848588aec9845001d749 to your computer and use it in GitHub Desktop.
The noob's guide to 3D Transforms with CSS - Translations
.translated-square {
transform:
translateX(20px) /* move right */
translateY(-20px) /* move down */
translateZ(20px); /* move closer to viewer */
}
.translated-square-shorthand {
transform: translate3d(20px, -20px, 20px);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment