Difference between revisions of "CSS GUIDE PADDING TOP"

From CDOT Wiki
Jump to: navigation, search
(Notes)
(Usage Examples)
Line 13: Line 13:
  
 
== 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 ==

Revision as of 03:31, 12 December 2006

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.

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.<pre>

Notes

Negative values are not allowed.

Specification Conformance

Browser Compatibility

== See Also ==