Skip to content

Instantly share code, notes, and snippets.

@anwas
Last active February 28, 2018 15:10
Show Gist options
  • Select an option

  • Save anwas/26562b72d3b8163c3b0dedd66662ecb6 to your computer and use it in GitHub Desktop.

Select an option

Save anwas/26562b72d3b8163c3b0dedd66662ecb6 to your computer and use it in GitHub Desktop.
[Center verticaly] #css #scss #centering
.element {
position: relative;
top: 50%;
transform: perspective(1px) translateY(-50%);
}
.parent-element {
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
transform-style: preserve-3d;
.element {
position: relative;
top: 50%;
transform: translateY(-50%);
}
}
@anwas
Copy link
Copy Markdown
Author

anwas commented Feb 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment