Skip to content

Instantly share code, notes, and snippets.

@anil-pace
Created August 15, 2020 04:21
Show Gist options
  • Select an option

  • Save anil-pace/e0b9219685ed2e96b430a00ca1656e8d to your computer and use it in GitHub Desktop.

Select an option

Save anil-pace/e0b9219685ed2e96b430a00ca1656e8d to your computer and use it in GitHub Desktop.
.parent{
position: relative;
height: 100px; # 100vh
width: 100px; # 100vw
border: 1px solid red;
}
.child{
position: absolute;
border: 1px solid green;
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