The padding
property specifies how much space should appear between the content of an element and its border. It is a shorthand for padding-top
, padding-right
, padding-bottom
, and padding-left
.
Using the shorthand property to set the padding for all four sides of a <p>
element to 40 pixels.
p { padding: 40px; }
Setting multiple padding values for the four sides of a <p>
element.
The top padding is 10px.
The right padding is 5px.
The bottom padding is 15px.
The left padding is 20px.
p { padding: 10px 5px 15px 20px; }
padding: value;
padding-top
, padding-right
, padding-bottom
, and the padding-left
properties, respectively.For more information, see http://www.w3schools.com/cssref/pr_padding.asp
Found a bug in the documentation? Let us know at documentation@code.org