Easy Tutorial
❮ Jsref Regexp Begin Not Met Console Time ❯

Style paddingRight Property


Definition and Usage

The paddingRight property sets or returns the right padding of an element.

Syntax

Set the paddingRight property:

Return the paddingRight property:

Value Description
% Defines the right padding as a percentage of the width of the parent element.
length Defines the width of the right padding using units like px, cm, etc.
inherit The right padding is inherited from the parent element.

Browser Support

All major browsers support the paddingRight property.

Note: IE7 and earlier versions do not support the "inherit" value. IE8 requires a !DOCTYPE to support "inherit". IE9 supports "inherit".


Tips and Notes

Both the margin and padding properties insert space around an element. However, the difference is that margin inserts space outside the border, while padding inserts space inside the border.


Example

Change the right padding of a div element:

❮ Jsref Regexp Begin Not Met Console Time ❯