Skip to content

Instantly share code, notes, and snippets.

@anshuraj
Created June 5, 2018 09:45
Show Gist options
  • Save anshuraj/fd94b3876e04693e805dc6acfe075981 to your computer and use it in GitHub Desktop.
Save anshuraj/fd94b3876e04693e805dc6acfe075981 to your computer and use it in GitHub Desktop.
Center a div
.centered-div{
width: auto;
position: relative;
transform: translate(-50%, 0);
left: 50%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment