Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE HTML>
<html lang="en-US">
<head>
  <meta charset="UTF-8">
  <title>Demo box</title>
  
  <style type="text/css">
    #box {
      width: 25%;
      padding-bottom: 25%;
      background: #00F;
      color: #FFF;
      position: relative;
    }
    #innerContent {
      position: absolute;
      left: 10px;
      right: 10px;
      top: 10px;
      bottom: 10px;
      background: #66F;
    }
  </style>
  
</head>
<body>
  <div id="box">
    <div id="innerContent">
      Absolutely-positioned content isn't counted in the parent's height!
    </div>
  </div>
  
</body>
</html>
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers