Created
June 9, 2017 19:58
-
-
Save tlindsay/a9a87970062c692a67e268f424d6d1bc to your computer and use it in GitHub Desktop.
Horizontally and Vertically Center SVGs
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
<style> | |
.wrapper { | |
position: relative; | |
svg { | |
bottom: 50%; | |
left: 50%; | |
position: absolute; | |
right: 50%; | |
top: 50%; | |
transform: translate(-50%, -50%); | |
} | |
} | |
</style> | |
<div class="wrapper"> | |
<svg> | |
<!-- SVG stuff --> | |
</svg> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment