Set the flex items vertically with CSS

CSSWeb DevelopmentFront End Technology

To set the flex items vertically, use the flex-direction property. You can try to run the following code to display flex items vertically


Live Demo

<!DOCTYPE html>
         .mycontainer {
            display: flex;
            flex-direction: column;
            background-color: orange;
         .mycontainer > div {
            background-color: white;
            text-align: center;
            line-height: 40px;
            font-size: 25px;
            width: 100px;
            margin: 5px;
      <div class = "mycontainer">
Published on 31-May-2018 12:33:29