How to work with Flexbox elements in CSS?

Define a flex container and set the flex items in it.

You can try to run the following code to learn how to implement Flexbox elements. Q1, Q2, Q3 here are the flex-items. The entire area is Flexbox element


Live Demo

<!DOCTYPE html>
         .mycontainer {
            display: flex;
            background-color: orange;
         .mycontainer > div {
            background-color: white;
            text-align: center;
            line-height: 40px;
            font-size: 25px;
            width: 100px;
            margin: 5px;
      <div class = "mycontainer">