Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Position relative absolute">
  <meta charset="utf-8">
  <title>Position relative absolute</title>
</head>
<body>
  
  <style>
    .id0 {
      position: relative;
      top: 70px; left: 50px;
      width: 400px;
      line-height: 100px;
      background: gray;
    }
    
    .id1 {
      width: 100px;
      line-height: 100px;
      background: green;
      text-align: center;
    }
    
    .id2 {
      position: absolute;
      top: 70px; left: 150px;
      width: 160px;
      line-height: 80px;
      background: yellow;
      text-align: center;
    }
    
    .id3 {
      width: 260px;
      line-height: 200px;
      background: blue;
      text-align: center;
      color: white;
    }
  </style>
  <div class="id0">
    <div class="id1">base element</div>
    <div class="id2">position absolute</div>
    <div class="id3">normal flow</div>
  </div>
  
</body>
</html>
Output

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

Dismiss x