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>
  <style>
    #child {
     width:300px;
     height:300px;
     background:green;
     position:fixed;
     left:50%;
     top:50%;
     margin-left:-150px;
     margin-top:-150px;
    }
    #parent {
      display: block;
      position: absolute;
      width: 400px;
      height: 400px;
      background: red;
      bottom: 0;
      left: 0;
    }
   </style>
</head>
<body>
<div id="parent">
   I am parent div.
  <div id="child">Always center no matter where the Parent div is</div>
</div>
</body>
</html>
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers