From http://www.w3schools.com (Copyright Refsnes Data)
The padding property is a shorthand property for setting all of the padding properties in one declaration.
Note: Negative values are not allowed.
Inherited: No
CSS properties can also be dynamically changed with a JavaScript.
Scripting Syntax: object.style.padding="2cm"
In our HTML DOM tutorial you can find more details about the padding property.
In our HTML DOM tutorial you can also find a full Style Object Reference.
h1 {padding: 10px} h1 {padding: 10px 2%} h1 {padding: 10px 2% 15px} h1 {padding: 10px 2% 15px 20px} |
Value | Description |
---|---|
padding-top padding-right padding-bottom padding-left |
Sets the padding. The values comes in %
(defines padding in % of the width of the closest element) and length (defines a fixed
padding). Default value: Not defined |
All the padding properties in one
declaration
This example demonstrates a shorthand property for setting all of the padding
properties in one declaration, can have from one to four values.
From http://www.w3schools.com (Copyright Refsnes Data)