HTML CSS examples for CSS Layout:Flex Row
get an absolutely positioned item inside a relatively positioned flexbox container to grow
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> body {<!-- w w w.ja va 2s . c o m--> width:300px; height:600px; margin:0; } html { width:100%; height:100%; } .container { position:relative; width:100%; height:100%; background:blue; display:flex; flex-direction:row; align-content:stretch; } .item { flex: 1 1 0; height: 10%; margin-top: 10%; min-width: 50%; } </style> </head> <body> <div class="container"> <div style="background:tomato" class="item"></div> <div style="background:cyan" class="item"></div> </div> <br> <div class="container"> <div style="background:tomato" class="item"></div> </div> </body> </html>