How to Add a Fixed Width Column with CSS Flexbox

Solution with Flexbox

If you want to have a fixed-width column with Flexbox, you need to use the CSS flex or flex-basis property.

First of all, we set the display of our <div> container to "flex". Then, we specify the flex of the "grey" class as "0 0 50px". Here, the first value specifies flex-grow, the second defines flex-shrink, and the last one specifies flex-basis.

For both the "green" and "blue" classes, we set the flex to 1.

Example of setting a fixed-width column with Flexbox:

<!DOCTYPE html>
    <title>Title of the document</title>
      .flexbox {
        display: flex;
      .grey {
        background: #adadad;
        flex: 0 0 50px;
      .green {
        background: #32c962;
        flex: 1;
      .blue {
        background: #3b66db;
        flex: 1;
    <div class="flexbox">
      <div class="grey">1</div>
      <div class="green">2</div>
      <div class="blue">3</div>