Flexbox Playground

Explore Flexbox direction, alignment, distribution, wrapping, and gap visually.

1
2
3
4

Generated CSS

.container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 16px;
}

Main axis and cross axis

flex-direction defines the main axis. justify-content distributes items along it, while align-items controls the cross axis.

Gap and wrapping

gap creates consistent spacing without individual margins. flex-wrap lets items move to another line when space runs out.

Explore all web development tools

Related tools