CSS Tutorial

The language for styling web pages.

CSS Padding

CSS Padding

Padding is used to create space around an elements content, inside of any defined borders.

Padding Properties:

  • padding-top
  • padding-right
  • padding-bottom
  • padding-left
  • padding - Shorthand (same as margin shorthand)

Note: Padding adds to the total size of the element unless you use box-sizing: border-box.

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics