Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example of CSS3 align-items Property</title> <style> .flex-container { height: 200px; width: 300px; font-size: 32px; border: 1px solid black; /* Safari */ display: -webkit-flex; -webkit-align-items: center; /* Standard syntax */ display: flex; align-items: center; } .flex-container div { height: 100px; width: 75px; -webkit-flex: 1; /* Safari */ flex: 1; } .item1 { background: #e84d51; } .item2 { background: #7ed636; } .item3 { background: #2f97ff; } </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>