HTML CSS examples for CSS Layout:Flex Row
Layout child to be the only on its row within its flexbox
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .parent {<!--from w w w.j a v a 2 s . c o m--> padding: 10px 0; display: flex; flex-flow: row wrap; align-content: center; justify-content flex-start; } .child { margin: 10px; flex: 1 0 auto; min-width: 40%; min-height: 50px; } .child.stretch { flex: 1 100%; } .red {background:red;} .green {background:green;} .blue {background:blue;} .yellow {background:yellow;} </style> </head> <body> <div class="parent"> <div class="child red"></div> <div class="child green"></div> <div class="child stretch blue"></div> <div class="child yellow"></div> </div> this is a test this is a tst </body> </html>