Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html dir="ltr"> 
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<div class="container">
  <div class="item item1">1</div>
  <div class="item item2">2</div>
  <div class="item item3">3</div>
  <div class="item item4">4</div>
  <div class="item item5">5</div>
  <div class="item item6">6</div>
  <div class="item item7">7</div>
  <div class="item item8">8</div>
  <div class="item item9">9</div>
</div>
</body>
</html>
 
/* CSS reset */
*, *::before, *::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
/* Styles */
.container {
  border: 1px solid red;
  height: 300px;
  width: 300px;
  display: grid;
  grid-template-columns: repeat(3, 50px);
  grid-template-rows: repeat(3, 50px);
  place-content: center;
  /*
  align-content: center;
  justify-content: center;
  */
  place-content: start end;
  /*
  align-content: start;
  justify-content: end;
  */
}
.item {
  border: 1px solid green;
}
Output 300px

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers