CSS Grid & Flexbox Generator

Configure a layout using CSS Flexbox or Grid, preview it with sample boxes, and copy the CSS code for your project.

Layout mode

CSS Code

.container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: stretch;
  gap: 12px;
}
.item {
  padding: 12px;
  border-radius: 0.75rem;
  background: rgb(15 23 42);
  border: 1px solid rgb(30 64 175);
  color: rgb(226 232 240);
}

Layout Preview

1
2
3
4
5
6

Related tools