Skip to Content


CSS Reference / padding

padding

A shorthand for the four padding properties. Negative values are not allowed. The shorthand padding properties are defined clockwise starting from top.

Values:

Examples:

  1. padding: 10px; /* all four padding properties */
  2. padding: 2em 4em; /* 2em top/bottom and 4em sides */
  3. padding: 5px 6px 7px 8px; /* different padding on all sides */

Browser support:

  • Internet Explorer 4+
  • Netscape 4+
  • Opera 3.5+

Related properties:

back to list



Search

Sponsors

Logo design for $149

Advertise here