h1 {
  font-size: 50px;
  text-align: center;
}
body {
  background-color: darkblue;
}
div {
  font-family: sans-serif;
  font-size: 40px;
  text-align: center;
}
   .flex
   {
      /* basic styling */
      height: 600px;
      width: 900px;
      border: 5px solid #555;
      font: 14px Arial;
      margin: auto;

      /* flexbox setup */
      display: -webkit-flex;
      -webkit-flex-direction: column;

      display: flex;
      flex-direction: column;
   }

   .flex > div
   {
      -webkit-flex: 1 1 auto;
      flex: 1 1 auto;

      height: 30px; /* To make the transition work nicely.  (Transitions to/from
                      "width:auto" are buggy in Gecko and Webkit, at least.
                      See http://bugzil.la/731886 for more info.) */

      -webkit-transition: height 0.7s ease-out;
      transition: height 0.7s ease-out;
   }

   /* colors */
   .flex > div:nth-child(1){ background : #FF0000; }
   .flex > div:nth-child(2){ background : #FFFF00; }
   .flex > div:nth-child(3){ background : #FF0000; }

   .flex > div:hover
   {
        height: 200px;
   }