Skip to content

Instantly share code, notes, and snippets.

@MariaJackson1
Last active August 8, 2022 21:12
Show Gist options
  • Save MariaJackson1/ac2f0c71394504ab86b5ca25ab5e63c5 to your computer and use it in GitHub Desktop.
Save MariaJackson1/ac2f0c71394504ab86b5ca25ab5e63c5 to your computer and use it in GitHub Desktop.
Center Elements
.🦄 {
display: flex;
align-items: center;
justify-content: center;
}
body {
display: grid;
place-items: center;
height: 100vh;
}
.foo {
position: absolute;
top: 50%;
left: 50%;
transform: translate (-50% -50%);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment