HomeReferencesCSS Properties

CSS Property: padding, padding-top, padding-right, padding-bottom, padding-left

Specifies the padding of a box.

HTML Dog, The Book HTML Dog book cover

HTML Dog is hosted by Titan Internet

Possible Values

  • [percentage]
  • [length] - ("0" is default)
  • inherit
  • padding can have:
    • one value, such as 10px, to specify equal padding on every side
    • two values, such as 10px 5px, to specify top/bottom (first value) and right/left (second value) padding
    • three values, such as 10px 5px 2px, to specify top (first value), right/left (second value) and bottom (third value) padding
    • four values, such as 10px 5px 2px 1px to specify top, right, bottom and left padding respectively

Example


#flump { padding: 10em 2em; }