CSS Attributes Index Box Attributes
Sets or retrieves how much space to insert between the object’s left border and the content.
CSS |
{ padding-left: length | percentage } |
Script |
object.style.paddingLeft = length | percentage |
length |
Floating-point number and a valid CSS length unit: either an absolute units designator ( cm, mm, in, pt, pc, or px ) or a relative units designator ( em or ex ). |
percentage |
Value expressed as a percentage of the parent object’s width. |
The property is read/write with a default value of 0; this attribute is not inherited.
Negative values are not allowed.
The sample below uses inline event handlers to dynamically set an object’s paddingLeft property in response to mouse events.
<td onmouseover="this.style.paddingLeft='1cm'"
onmouseout="this.style.paddingLeft=''">
<img src="../shared/images/neptune.gif">
</td>
Show me
BODY, BUTTON, CAPTION, currentStyle, DIV, HTMLAREA, IFRAME, IMG, ISINDEX, MARQUEE, runtimeStyle, style, TABLE, TD, TEXTAREA, TR
padding, padding-bottom, padding-right, padding-top