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>JS Bin</title>
</head>
<body>
  <div class="ct">
    <div class="el"><p>flex</p></div>
    <div class="el"><p>flex</p></div>
    <div class="el"><p>flex</p></div>
    <div class="el"><p>flex</p></div>
    <div class="el"><p>flex</p></div>
    <div class="el"><p>flex</p></div>
    <div class="el"><p>flex</p></div>
    <div class="el"><p>flex</p></div>
    <div class="el"><p>flex</p></div>
    <div class="el"><p>flex</p></div>
    <div class="el"><p>flex</p></div>
    <div class="el"><p>flex</p></div>
  </div>
</body>
</html>
 
.ct {
  background-color : #ffff00;
  display: flex;
  justify-content: flex-start; /* center if you want to the center */
  align-items: center;
  flex-wrap: wrap;
}
.el {
  width : 50px;
  height : 50px;
  background-color : #ff9999;
  margin : 5px;
  display: flex;
  justify-content: center; /* center inside flex items */
  align-items: center; /* center inside flex items */
}
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers