Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> .box { display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; width: 310px; height: 310px; border: 2px solid green; } .box div { width: 100px; padding: 15px; text-align: center; color: #000000; font-family: arial, sans-serif; } .green { background-color: green; } .blue { background-color: blue; } .gray { background-color: gray; } .pink { background-color: pink; } </style> </head> <body> <h2>Flex property example</h2> <div class="box"> <div class="green">GREEN</div> <div class="blue">BLUE</div> <div class="gray">GRAY</div> <div class="pink">PINK</div> </div> </body> </html>