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">
    <h1>Element taking space</h1>
      <div class="stretch">Not much content, but needs to be stretched to the end.</div>
    <div class="stretch">Not much content, but needs to be stretched to the end.</div>
  </div>
</body>
</html>
 
.parent {
  
  background-color: #eee;
  border: 1px solid black;
  width: 600px;
  height: 600px;
  display:table;
  
}
h1{
  display:table-row;
  width:100%;
}
.stretch{
  
  vertical-align:top;
  display:table-cell;
  height:100%;
  background-color: #ddd;
  
}
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers