CHECK DEMO
I am trying bring the child div element to a new line when the parent div's width exceeds.I tried display:flex ,but when the parent width is exceeded the child div does not come to a new line.Like a bootstrap class row when the child div elements exceeds width of parent element it should be placed in new line.
HTML
<div class="wrap">
<div class="block">Block 1</div>
<div class="block">Block 2</div>
<div class="block">Block 3</div>
<div class="block">Block 4</div>
<div class="block">Block 5</div>
</div>
CSS
.wrap
{
width:140px;
display:flex;
background:yellow;
}
.block
{
margin-right:5px;
width:70px;
}