Skip to content

Instantly share code, notes, and snippets.

@Shaz3e
Created December 17, 2013 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shaz3e/8004300 to your computer and use it in GitHub Desktop.
Save Shaz3e/8004300 to your computer and use it in GitHub Desktop.
.s3-relative{
position:relative;
width:100%;
height:100%;
}
.s3-absolute{
position:absolute;
top:0;
right:0;
bottom:0;
left:0;
width:50%;
height:50%;
margin:auto;
padding:1em 0;
background-color:#000;
color:#fff;
text-align:center;
}
<div clss="s3-relative">
<div class="s3-absolute">
The centered absolute div under relative div
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment