Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

CSS padding-right property


May 06, 2021 CSS Reference Manual


Table of contents


CSS padding-right Property


Set the right fill of a P element:

p
{
padding-right:2cm;
}

Try it out . . .

Description of property definition and use

The padding-right property sets the right padding (blank) of an element.

Note: Negative values are not allowed.

Default: 0
Inherited: no
Version: CSS1
JavaScript syntax: object .style.paddingRight="2cm"


Browser support

The numbers in the table support the first browser version number of the property.

Attributes
padding-bottom 1.0 4.0 1.0 1.0 3.5

The property value

Value Describe
length Specifies fixed right margin values in specific units, such as pixels, centimeters, etc. The default is 0px.
% Defines the right inner margin based on the percentage of the width of the parent element. This value does not work in all browsers as expected.
inherit Specifies that the right inner margin should be inherited from the parent element.


Related articles

CSS tutorial: CSS Padding