Skip to content

Instantly share code, notes, and snippets.

Forked from YohannParis/center.css
Last active Dec 27, 2015
What would you like to do?
CSS: centering
* To horizontally and vertically center an element in css:
.center {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 20em;
height: 20em;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment