Lay out a page visually and copy clean CSS.
.container {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
align-items: center;
gap: 12px;
}Switch between Flexbox and Grid.
Change direction, alignment, gaps and tracks and watch the preview update.
Copy the CSS for the container and its items.
Flexbox arranges items in one direction, and Grid lays them out in rows and columns. Both are powerful, and both have many properties that are easier to understand when you can see them move.
Adjust the controls, see the layout respond and copy only the CSS you need. Everything runs in your browser.