Skip to content

Instantly share code, notes, and snippets.

@ManotLuijiu
Created May 14, 2022 11:27
Show Gist options
  • Save ManotLuijiu/663f5991c3af42dd38100c75ed32d2c5 to your computer and use it in GitHub Desktop.
Save ManotLuijiu/663f5991c3af42dd38100c75ed32d2c5 to your computer and use it in GitHub Desktop.
Using Grid to center
<div class="container">
<h1>Center an element both Horizontally and Vertically using grid</h1>
</div>
body,
html {
height: 100%;
display: grid;
}
.container {
margin: auto;
}
h1 {
color: #0984e3;
font-size: 80px;
text-align: center;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment