Name

padding-left

Values:

<length> | <percentage> | inherit

Initial value:

0

Applies to:

All elements.

Inherited:

No.

Percentages:

Refer to the width of the containing block.

Computed value:

For percentage values, as specified; for length values, the absolute length.

Note:

Padding can never be negative.

Description:

This property sets 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;}

Supported by:

Firefox, Internet Explorer, Opera, Safari.

Get CSS Pocket Reference, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.