Padding is the empty space inside an element, sitting between its content and its outer edge. When a button has comfortable padding, the label is not jammed against the border. When a card has padding, the text inside has room to breathe instead of touching the walls. It is one of the most basic tools for making an interface feel calm rather than crowded.

Think of a picture in a frame. The mat board around the photo, that border of empty space before the frame begins, works just like padding. Without it the image feels squeezed and cheap. With it, the picture has presence. The same effect happens on screen, which is why padding is a core part of good UI design and a practical form of whitespace.

It helps to know how the numbers behave. Padding is set per side, so padding: 16px 24px means 16 pixels top and bottom, 24 left and right. A button often needs more horizontal padding than vertical to look balanced, because text is wider than it is tall. Get the ratio wrong and the label looks pinched or the button looks bloated. Designers usually pull these values from a fixed scale, like 4, 8, 16, 24, so spacing across the whole interface lines up instead of using random numbers. Padding also shapes tappability. On a phone, a link with generous padding is easy to hit with a thumb, while a tight one causes mis-taps and frustration. Apple and Google both recommend a touch target of around 44 pixels, and padding is how you reach it without making the visible element huge. Getting this right across screen sizes is part of solid responsive design.

At TopDevs we set consistent padding through design tokens, so spacing stays even across every page and screen instead of drifting element by element.