Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example of CSS3 flex-basis Property</title> <style> .flex-container { width: 300px; height: 200px; font-size: 32px; border: 1px solid black; display: -webkit-flex; /* Safari */ display: flex; /* Standard syntax */ } .item1 { background: #e84d51; -webkit-flex-basis: 150px; /* Safari */ -ms-flex-basis: 150px; /* IE 10 */ flex-basis: 150px; } .item2 { background: #7ed636; -webkit-flex-basis: 40%; /* Safari */ -ms-flex-basis: 40%; /* IE 10 */ flex-basis: 40%; } .item3 { background: #2f97ff; width: 50px; } </style> </head> <body> <div class="flex-container"> <div class="item1">1</div> <div class="item2">2</div> <div class="item3">3</div> </div> </body> </html>