CSS padding-right property
padding-right property
CSS padding-right property sets the right padding of a box.
Syntax:
padding-right: width | inherit
Values
width: Width of the right padding. The following table shows the values used to set width:
Type | Description |
---|---|
Length | If specified, a fixed width is set. |
Percentage | Using percentage sign followed by a number, a percentage value is set. The percentage is represented with respect to the width of the box. |
inherit : If set, the associated element takes computed value of its parent element's padding-right property.
Initial value
0
Applies to
padding-right property can be applied to all elements except elements with table display types other than table-caption, table and inline-table.
Inherited
No.
Percentages
With reference to the width of the containing block.
Media
visual.
Computed value
Either a percentage or absolute value.
Browser compatibility
Browser | Version |
---|---|
Internet Explorer | 4.0 and above |
Firefox (Gecko) | 1.0 and above |
Opera | 3.5 and above |
Safari (WebKit) | 1.0 and above |
Example of padding-right property
CSS code:
HTML code:
View this example in a separate browser window
Example of padding-right property.
Pictorial presentation

Previous: CSS padding-left property
Next:
CSS padding shorthand property
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics