asp.net.ph

Skip Navigation LinksAbakada: Back to Basics > Language References > CSS Properties > Box Properties > padding-left Property

padding-left | paddingLeft Property


Sets or retrieves how much space to insert between the object’s left border and the content.

Syntax

CSS { padding-left: length | percentage }
Script object.style.paddingLeft = length | percentage

Possible Values

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.

Remarks

Negative values are not allowed.

Example

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 

Applies To

BODY, BUTTON, CAPTION, currentStyle, DIV, HTMLAREA, IFRAME, IMG, ISINDEX, MARQUEE, runtimeStyle, style, TABLE, TD, TEXTAREA, TR

See Also

padding, padding-bottom, padding-right, padding-top

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note