Skip to content

Instantly share code, notes, and snippets.

@mksddn
Last active December 6, 2023 06:40
Show Gist options
  • Save mksddn/cc0de8ffb04c733cf1e185217e173b96 to your computer and use it in GitHub Desktop.
Save mksddn/cc0de8ffb04c733cf1e185217e173b96 to your computer and use it in GitHub Desktop.
Centering css
.center {
position: absolute;
top: 50%;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment