<style> #flex-demo { width: 300px; height: 300px; border: 1px solid black; display: -webkit-flex; /* Safari */ display: flex; } #flex-demo div { -webkit-flex: 1; /* Safari 6.1+ */ -ms-flex: 1; /* IE 10 */ flex: 1; } </style> </head> <body> <h1>The flex Property</h1> <div id="flex-demo"> <div style="background-color:blue; color:#fff;">RED</div> <div style="background-color:maroon; color:yellow;">BLUE</div> <div style="background-color:green; color:#fff;">Green div with more content.</div> </div> </body> </html>