Skip to content

Instantly share code, notes, and snippets.

@tommcfarlin
Created January 24, 2018 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tommcfarlin/6fcfa9dd108af20920c937b2a1fa66c4 to your computer and use it in GitHub Desktop.
Save tommcfarlin/6fcfa9dd108af20920c937b2a1fa66c4 to your computer and use it in GitHub Desktop.
[CSS] A Quick Tip for Dynamically Centering An Element in a Container Using CSS
.acme-element {
position: relative;
top: 50%;
transform: translateY(-50%);
height: auto;
max-height: 190px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment