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="container">
    <div class="item"></div>
    <div class="item abs"></div>
  </div>
</body>
</html>
 
.container {
  width: 300px;
  height: 300px;
  border: 2px solid black;
  display: flex;
  justify-content: center;
  position: relative;
}
.container > * { align-self: center;}
.item {
  width: 100px;
  height: 100px;
  background: green;
}
.abs {
  position: absolute;
  background: blue;
}
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers