O'Reilly logo

CSS Pocket Reference, 4th Edition by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

padding-left

Values:

<length> | <percentage>

Initial value:

0

Applies to:

All elements

Inherited:

No

Percentages:

Refer to the width of the containing block

Computed value:

For percentage values, as declared; for length values, the absolute length

Description:

Defines the width of the left padding for an element. Left padding set for an inline nonreplaced element will appear only on the left edge of the first inline box generated by the element. Negative padding values are not permitted.

Examples:

p {padding-left: 5%;}
pre {padding-left: 3em;}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required