Answers for "restrict flex items in a row"

CSS
1

restrict flex items in a row

.parent {
    display: flex;
    flex-wrap: wrap;
  }

  .child {
    /* percent per item in row. 
    33% = limit to 3 per row. */
    flex: 1 0 33%; 
    margin: 5px;
    height: 100px;
    background-color: blue;
  }
Posted by: Guest on May-01-2021

Browse Popular Code Answers by Language