MDN’s new design is in Beta! A sneak peek: https://blog.mozilla.org/opendesign/mdns-new-design-beta/

The padding-right CSS property sets the width of the padding area on the right side of an element. The padding area is the space between the element's content and its border. Unlike margins, negative values are not allowed for padding. The padding shorthand property can be used to set paddings on all four sides of an element with a single declaration.

/* <length> values */
padding-right: 0.5em;
padding-right: 0;
padding-right: 2cm;

/* <percentage> value */
padding-right: 10%;

/* Global values */
padding-right: inherit;
padding-right: initial;
padding-right: unset;

Initial value0
Applies toall elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column. It also applies to ::first-letter.
Inheritedno
Percentagesrefer to the width of the containing block
Mediavisual
Computed valuethe percentage as specified or the absolute length
Animation typea length
Canonical orderthe unique non-ambiguous order defined by the formal grammar

Syntax

Values

<length>
A fixed width of the padding. Must be nonnegative.
<percentage>
A percentage width of the padding with respect to the width of the containing block. Must be nonnegative.

Formal syntax

<length> | <percentage>

Examples

.content { padding-right: 5%; }
.sidebox { padding-right: 10px; } 

Specifications

Specification Status Comment
CSS Basic Box Model
The definition of 'padding-right' in that specification.
Working Draft No change.
CSS Transitions
The definition of 'padding-right' in that specification.
Working Draft Defines padding-right as animatable.
CSS Level 2 (Revision 1)
The definition of 'padding-right' in that specification.
Recommendation No change.
CSS Level 1
The definition of 'padding-right' in that specification.
Recommendation Initial definition.

Browser compatibility

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 1.0 (Yes) 1.0 (1.0) 4.0 3.5 1.0 (85)
Feature Android Edge Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support ? (Yes) ? ? ? ?

See also

Document Tags and Contributors

 Last updated by: mfluehr,