CSS
CSS PaddingCSS Padding
CSS padding creates empty space inside an element.
Read Time
5 min readDifficulty
BeginnerLast Updated
Jun 15, 2026Version
v1.0.0Introduction
CSS generates transparent space inside the border of an element, pushing its content inward. Developers use padding to give text breathing room so it doesn't touch the borders. You can set padding for all four sides.
Syntax
Syntax
Example
Example
Key Points
- Padding sits inside the element's border.
- The padding area inherits the background color.
- Padding pushes the inner content inward.
- The `padding` shorthand sets all four sides at once.