<!DOCTYPE html>
<html lang="en-US">
<head>
<style>
#parent{
display: flex;
width: 100%;
min-height: 150px;
border: 1px solid #8c8c8c;
}
#parent > div{
width: 90px;
height: 90px;
border: 1px solid #8c8c8c;
margin: 10px;
}
</style>
</head>
<body>
<h1>CSS flex-wrap Property</h1>
<div id="parent">
<div>Div 1</div>
<div>Div 2</div>
<div>Div 3</div>
</div>
<button onclick="myFunction()">Click Me</button>
<script>
var x = document.getElementById("parent");
function myFunction(){
x.style.flexWrap = "wrap";
}
</script>
<p><strong>Note</strong>: Click on the button to change the 'flex-wrap' from nowrap (default) to wrap and then, try to reduce the width of this output window.</p> </body>
</html>