Role of CSS justify-content property center value

CSSWeb DevelopmentFront End Technology

Use the justify-content property with value center to align the flex-items to the center.

You can try to run the following code to implement the center value:


Live Demo

<!DOCTYPE html>
         .mycontainer {
            display: flex;
            background-color: red;
            justify-content: center;
         .mycontainer > div {
            background-color: orange;
            text-align: center;
            line-height: 60px;
            font-size: 30px;
            width: 100px;
            margin: 5px;
      <div class = "mycontainer">
Published on 24-May-2018 16:25:41