Visit Mozilla.org

CSS:padding-left

From MDC

« CSS Reference

[edit] Summary

padding-left property of an element sets the padding space required on the left side 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 width of closest block-level ancestor
  • Media: visual
  • Computed value: the percentage as specified or the absolute length

[edit] Syntax

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

[edit] Values

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

[edit] Examples

View Live Examples

  .content {
    padding-left: 5%;
  }

  .sidebox {
    padding-left: 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