Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

padding property

Sets or retrieves the amount of space to insert between the object and its margin or, if there is a border, between the object and its border.

CSS 2.1, Section 5.5.10


Integer value = object.put_padding( v);Integer value = object.get_padding(* sPadding);

Property values

Type: BSTR

length (0)

Floating-point number, followed by an absolute units designator (cm, mm, in, pt, or pc) or a relative units designator (em, ex, or px). For more information about the supported length units, see CSS Values and Units Reference.


Integer, followed by a %. The value is a percentage of the width of the parent object.

String format

<length> | <percentage>

CSS information

Applies ToAll elements
Initial Value

Standards information


This is a composite property that specifies up to four padding values, in the following order: top, right, bottom, left. If one width value is specified, it is used for all four sides. If two width values are specified, the first is used for the top and bottom borders, and the second is used for left and right borders. If three width values are specified, they are used for top, right/left, and bottom borders, respectively. Negative values are not allowed.

As of Microsoft Internet Explorer 5.5, this property applies to inline elements. With earlier versions of Windows Internet Explorer, inline elements must have an absolute IHTMLCurrentStyle::position or layout to use this property. Element layout is set by providing a value for the IHTMLCurrentStyle::height property or the IHTMLCurrentStyle::width property.


Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]







See also

CSS Enhancements in Internet Explorer 6



Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.