-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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