Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
<div class="parent">
  <div class="child">
    <!-- content -->
  </div>
</div>
</body>
</html>
 
/* These are the base rule to set the dead center */
.parent
{
  position : relative;
}
.child
{
  position : absolute;
  top: 0 ;
  right: 0 ;
  bottom : 0 ;
  left : 0 ;
  margin : auto;
}
/* these are addtional rules */
.parent
{
  width : 300px;
  height: 300px;
  background : red;
}
.child
{
  width:100px;
  height:100px;
  background:blue;
  text-align:center;
  line-height:100px;
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
ijasnijaspro
0viewers