Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>CSS Positioning</title>
</head>
<body>
  <div class="parent">
    <div class="box-1">Box 1</div>
    <div class="box-2">Box 2</div>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cumque recusandae repellendus neque ipsum veritatis, accusamus iusto voluptatibus, quaerat voluptate dolor commodi, cupiditate beatae ducimus facere ex voluptatem deleniti quo modi?</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloribus possimus dicta dolores saepe quae dolore quidem harum! Eaque dolores consequuntur, consequatur repudiandae, quasi, quis dolorum eligendi praesentium ipsum ipsam veniam!</p>
    <div class="box-3">Box 3</div>
    <div class="box-4">Box 4</div>
  </div>
</body>
</html>
 
.parent {
  width: 90%;
  border: 3px solid skyblue
  /* How to position the boxes
    relative to the .parent? */
}
[class^=box-] {
  position: absolute;
  width: 100px;
  height: 100px;
}
.box-1 {
  right: 0;
}
.box-2 {
  bottom: 0;
}
.box-3 {
  top: 0;
  left: 0;
}
.box-1 { background-color: gold; }
.box-2 { background-color: tomato; }
.box-3 { background-color: turquoise; }
.box-4 { background-color: darkcyan; }
Output

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

Dismiss x
public
Bin info
qolamipro
0viewers