padding-left

The padding-left property sets the left padding of an element.

Syntax

padding-left: <length> | <percentage> | inherit
Initial: 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 containing block
Media: visual

Values

padding-left: value
Value Initial Description
length 0 Specifies a fixed length
percentage Specifies a percentage of the containing block

DOM

[window.]document.getElementById("element-id").style.paddingLeft = "padding-left";

Example | length

Example | percentage

Example | DOM

External

W3C Cascading Style Sheets, level 1

W3C Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification