CSS/Properties/padding-right
From Web Education Community Group
< CSS | Properties
Contents |
padding-right
The padding-right property sets the right padding of a box.
Description
| Values | [<length> | <percentage>] | inherit |
|---|---|
| Initial value | 0 |
| Applies to | all elements except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column |
| Inherited | No |
Values
<length>
<percentage>
inherit
Takes the same specified value as the property for the element's parent.
Example
Example A
[style.css]
#body{
background-color: #666;
}
p{
background-color: #ccc;
}
#pad{
padding-top: 50px;
padding-right: 10px;
padding-bottom: 50px;
padding-left: 10px;
}
[index.html]
<body> <p>This is a paragraph</p> <p id="pad">This is a paragraph</p> <p>This is a paragraph</p> <p>This is a paragraph</p> </body>
CSS Reference
The CSS specification defines the padding-right property in 8.4 Padding properties.

