Skip to content

Instantly share code, notes, and snippets.

@otabekoff
Created June 29, 2022 06:56
Show Gist options
  • Save otabekoff/a3bcac4a0e5b0a4e144ec88c168e3ddc to your computer and use it in GitHub Desktop.
Save otabekoff/a3bcac4a0e5b0a4e144ec88c168e3ddc to your computer and use it in GitHub Desktop.
.parent {
border: 1px solid #333;
height: 250px;
position: relative;
width: 250px;
}
.child {
left: 50%;
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment