<html>
<style>
.box {
  border: 2px solid green;
  padding: 2px;
}

.container {
  border: 2px solid blue;
  height: 100px;
  width: 100px;
  position: absolute;
  padding:10px;
}

.leftright {
  position:absolute;
  left:0px;
  right:0px;
  top:0px;
  height:100px;
}

.topbottom {
  width: 100px;
  position:absolute;
  top:0px;
  bottom:0px;
  left:0px;
}
</style>
<body>
<div class="container">
<div class="leftright box"></div>
<div class="topbottom box"></div>
<div style="width:100%; height:100%; background: gray;"></div>
</div>

</body>
