Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> #flex { width: 300px; height: 100px; border: 1px solid #c3c3c3; display: -webkit-flex; /* Safari */ -webkit-justify-content: center; /* Safari 6.1+ */ display: flex; justify-content: center; } div { width: 70px; height: 70px; } </style> </head> <body> <h2>Display property example</h2> <p>Here the "display: flex;" is used:</p> <div id="flex"> <div style="background-color: #1c87c9;">1</div> <div style="background-color: #666;">2</div> <div style="background-color: #8ebf42;">3</div> </div> </body> </html>