Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<head>
<style> 
#container {
  width: 100%;
  height: 300px;
  margin: 10px 0;
  border: solid black 1px;
  display: flex;
  flex-wrap: wrap;
}
#container > div {
  height: 10%;
  aspect-ratio: 2/1;
  margin: 2px;
  background-color: lightblue;
}
</style>
</head>
<body>
<h1>Change place-content property with JavaScript</h1>
<p>Click the "Try it" button to change the place-content values of the flexbox container:</p>
<button onclick="myFunction()">Try it</button>
<div id="container"></div>
<script>
function myFunction() {
  document.getElementById("container").style.placeContent = "end space-around";
}
let containerEl = document.getElementById("container");
for(let i=0; i<17; i++){
  let divEl = document.createElement("div");
  containerEl.appendChild(divEl);
}