CSS flex-basis property

CSSWeb DevelopmentFront End Technology

Set the length of a flex item with the flex-basis CSS property.

You can try to run the following code to implement the flex-basis property −


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">
         <div style = "flex-basis: 350px">Q4</div>
Updated on 25-Jun-2020 07:03:42