style.padding (Property)

A shortcut means of specifying all the padding attributes for a styled element.

Availability:

CSS level - 1
DOM level - 2
JavaScript - 1.5
JScript - 3.0
Internet Explorer - 4.0
Netscape - 6.0
Property/method value type:String primitive
JavaScript syntax:-myStyle.padding
CSS syntax:padding: aWidth ...
Argument list:aWidthUp to four padding widths

This property lets you change the width of one or more of the padding regions around an object.

If you specify only one value, all four padding regions are set. Two values define the top and bottom with the first and the second then applies to the left and right. If three values are specified, the first controls the top, the second controls both left and right while the third controls the bottom edge. When all four values are specified, they are assumed to be in the order: top, right, bottom and left.

Width values can be specified using pixel values, em-dash units or percentages of the next outermost parent object. The auto keyword lets the browser decide for itself.

You can also specify the values independently with the following properties:

Warnings:

See also:JSSTag.paddings(), Measurement units, style.border, style.margin