Difference between revisions of "CSS GUIDE PADDING TOP"
(→Syntax) |
(→See Also) |
||
(10 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
* Inherited: No | * Inherited: No | ||
== Syntax == | == Syntax == | ||
− | TARGET_ELEMENT {padding-top: value;} | + | <pre>TARGET_ELEMENT {padding-top: value;}</pre> |
== Legal Values == | == Legal Values == | ||
+ | * length - entered in pixels (px), centimetres (cm) or inches (in)<br /> | ||
+ | * % - entered as a percentage corresponding to the height of closest element. | ||
== Mozilla Recommended Values == | == Mozilla Recommended Values == | ||
== Usage Examples == | == Usage Examples == | ||
+ | <pre>h2 {padding-top: 10px;} | ||
+ | Sets the top padding to be 10 pixels</pre> | ||
+ | |||
+ | <pre>h1 {padding-top: 10%;} | ||
+ | Sets the top padding to be 10% the height of the closest element.</pre> | ||
== Notes == | == Notes == | ||
+ | Negative values are not allowed. | ||
== Specification Conformance == | == Specification Conformance == | ||
+ | [http://www.w3.org/TR/CSS1#padding-top CSS 1]<br /> | ||
+ | [http://www.w3.org/TR/CSS21/box.html#propdef-padding-top CSS 2.1]<br /> | ||
+ | [http://www.w3.org/TR/2002/WD-css3-box-20021024/#the-padding CSS 3] | ||
== Browser Compatibility == | == Browser Compatibility == | ||
== See Also == | == See Also == | ||
+ | padding-bottom<br /> | ||
+ | ppadding-left<br /> | ||
+ | padding-right<br /> | ||
+ | padding |
Latest revision as of 03:35, 12 December 2006
Contents
Summary
This property sets the top padding of an given element.
- Inherited: No
Syntax
TARGET_ELEMENT {padding-top: value;}
Legal Values
- length - entered in pixels (px), centimetres (cm) or inches (in)
- % - entered as a percentage corresponding to the height of closest element.
Mozilla Recommended Values
Usage Examples
h2 {padding-top: 10px;} Sets the top padding to be 10 pixels
h1 {padding-top: 10%;} Sets the top padding to be 10% the height of the closest element.
Notes
Negative values are not allowed.
Specification Conformance
Browser Compatibility
See Also
padding-bottom
ppadding-left
padding-right
padding