Export (0) Print
Expand All

padding

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

{ padding: sPadding }

sPadding

String that specifies or receives one of the following values:

length

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 Length units reference.

percentage

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

The property has a default value of 0 for all objects. It is not inherited.

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.

The following example uses the padding property to change the padding of the object. This example uses the TD object as a selector and padding1 as a class in an embedded style sheet to set the padding for the TD object:

<style>
    td {padding:3mm 8mm}
    .padding1  {padding:1cm}
</style>
</head>
<body>
<table border >
    <td onmouseover="this.className='padding1'"
        onmouseout="this.className=''" align=middle>
    <img src="sphere.jpg">
    </td>
</table>

A, ABBR, ACRONYM, ADDRESS, APPLET, B, BDO, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, CUSTOM, DD, DEFAULTS, DEL, DFN, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, FRAME, HN, HR, I, IMG, INPUT TYPE=BUTTON, INPUT TYPE=CHECKBOX, INPUT TYPE=FILE, INPUT TYPE=IMAGE, INPUT TYPE=PASSWORD, INPUT TYPE=RADIO, INPUT TYPE=RESET, INPUT TYPE=SUBMIT, INPUT TYPE=TEXT, INS, LI, NEXTID, OBJECT, OL, P, Q, RT, RUBY, S, SELECT, SPAN, SUB, TABLE, TD, TH, TT, U, UL, VAR, XMP

Community Additions

ADD
Show:
© 2014 Microsoft