padding-top

Browser Internet Explorer Netscape Opera Safari Firefox
Version 5.5 6.0 7.0 8.0 8.0 9.0 7.0 8.0 9.2 9.5 1.3 2.0 3.1 1.5 2.0 3.0
Supported Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
Short information
CSS CSS1
Default value 0
Inherited No
Applied To all elements
HTML analog No
Reference to specification http://www.w3.org/TR/CSS21/box.html#propdef-padding-top
Description
It determines value of field from the top border of an element contents. Field is called the distance from internal border of an element framework to the imagined rectangle limiting its contents (fig. 1).

Syntax
padding-top: value | auto
Arguments
It is possible to specify size of the top field in pixels (px), percent (%) or other admissible units for CSS. The argument auto specifies that the size of a field will be automatically calculated by a browser.

Example

 
<!--
   .layer {
    background: #fc3; /* Background color */
    border-top: 5px solid #000; /* Top line parameters */
    border-bottom: 5px solid #000; /* Bottom line parameters */
    padding: 5px; /* Fields around the text */
    padding-top: 10%; /* Top field */
    padding-bottom: 10%; /* Bottom field */
   }
 
-->
<div class="layer">
   Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem nonummy nibh
   euismod tincidunt ut lacreet dolore magna aliguam erat volutpat. Ut wisis enim
   ad minim veniam, quis nostrud exerci tution ullamcorper suscipit lobortis nisl
   ut aliquip ex ea commodo consequat.</div>
The result of this example is shown on the figure 2

Object model
[window.]document.getElementById("elementID").style.paddingTop
Backup Server
Application Virtualization Client
Data Center Virtualization
Desktop virtualization