This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

padding-right

Summary

The padding-right CSS property of an element sets the padding space required on the right side of an element. The padding area is the space between the content of the element and its border. Contrary to margin-right values, negative values of padding-right are invalid.

Overview table

Initial value
0
Applies to
All elements (except table-*-group, table-row and table-column, br)
Inherited
No
Media
visual
Computed value
the percentage as specified or the absolute length
Animatable
Yes

CSS Object Model Property
:

Percentages
[[CSS percentages::refer to width of closest block-level ancestor]]

Syntax

  • padding-right: length
  • padding-right: percentage

Values

length
Specifies a positive fixed width. See length for details.
percentage
A percentage with respect to the width of the containing block.

Examples

The following examples use the padding-right property to change the padding of the elements.

td { padding-right: 20%; }

View live example

td { padding-right: 30px; }

View live example

Related specifications

CSS basic box model
W3C Working Draft
CSS 2.1, 8 Box model
W3C Recommendation

Attributions

  • Mozilla Developer Network cc-by-sa-small-wpd.svg.