flexbox grid

CSS
.container {
    max-width: 1335px;
    margin: 0 auto;
}
.grid-row {
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-start;
}
.grid-item {
    height: 550px; /*optional*/
    flex-basis: 20%; /* initial percantage */
    -ms-flex: auto;
    width: 259px; /*optional*/
    position: relative;
    padding: 10px; /*optional*/
    box-sizing: border-box;
}
@media(max-width: 1333px) {/*xl*/
	.grid-item {
    	flex-basis: 33.33%;
    }
}
@media(max-width: 1073px) {/*lg*/
    .grid-item {
    	flex-basis: 33.33%;
    }
}
@media(max-width: 815px) {/*md*/
	.grid-item {
    	flex-basis: 50%;
    }
}
@media(max-width: 555px) {/*sm*/
	.grid-item {
    	flex-basis: 100%;
    }
}/* Answer to: "flex grid css" */

/*
  Grid and flexbox. The basic difference between CSS Grid Layout
  and CSS Flexbox Layout is that flexbox was designed for layout
  in one dimension - either a row or a column. Grid was designed
  for two-dimensional layout - rows, and columns at the same time.

  For more information on how to use this, go to:
  https://www.w3schools.com/css/css3_flexbox.asp
*/
Source

Also in CSS: