Home
CSS
CSS Flexbox
Flex Container
Tryit: Using justify-content: space-around
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <head> <style> .flex-container { display: flex; justify-content: space-around; background-color: DodgerBlue; } .flex-container > div { background-color: #f1f1f1; width: 100px; margin: 10px; text-align: center; line-height: 75px; font-size: 30px; } </style> </head> <body> <h1>The justify-content Property</h1> <p>justify-content: space-around; displays the flex items with space before, between, and after the lines:</p> <div class="flex-container"> <div>1</div> <div>2</div> <div>3</div> </div> </body> </html>