Visit Mozilla.org

CSS:padding-top

From MDC

« CSS Reference

[edit] Summary

padding-top property of an element sets the padding space required on the top of an element. Padding area is the space between the content of the element and it's border. A negative values is not allowed.

  • Initial value: 0
  • Applies to: all elements except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column
  • Inherited: no
  • Percentages: refer to height of closest block-level ancestor
  • Media: visual
  • Computed value: the percentage as specified or the absolute length

[edit] Syntax

padding-bottom: <length> | <percentage> | inherit | auto;

[edit] Values

<length>
Specifies a fixed height.
<percentage>
a percentage with respect to the height of the containing block.

[edit] Examples

View Live Examples

  .content {
    padding-top: 5%;
  }

  .sidebox {
    padding-top: 10px;
  } 

[edit] Notes

[edit] Specifications

[edit] Browser compatibility

(FIXME)

Browser Lowest Version
Internet Explorer ?
Firefox ?
Netscape ?
Opera ?
Safari ?

[edit] See also

padding, padding-bottom, padding-left, padding-right, padding-top, -moz-padding-start, -moz-padding-end, border, margin