The most basic – but also most overlooked element of a design is spacing. This article explains how the different spacing utilities like padding, margin and space work in Tailwind CSS and when to use them.

These elements create space between elements and make it easy to only add space if there are more elements within a group. The gap utility works with Tailwind grids only and makes it even easier to add space between elements of a grid.

So whenever you design grids, use the gap utility instead of manually positioning the elements with margin, padding or space.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners