CodePen

HTML

            
              <div clss="s3-relative">
  <div class="s3-absolute">
    The centered absolute div under relative div
  </div>
</div>
            
          
!

↑ Insert the most common viewport meta tag

CSS

            
              .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;
}
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              
            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................