CSS padding-left Property

Description

The padding-left property of an element sets the padding space required on the left side of an element. The padding area is the space between the content of the element and it's border. A negative value is not allowed.

Initial value
0
Applies to
All elements
Inherited
No
Media
Visual
Computed value
<length> - the percentage as specified or the absolute length
Animatable
Yes
CSS Version
CSS1, CSS2, CSS3
JavaScript syntax
object.style.paddingLeft

Syntax

padding-left: [ <length> | <percentage> ]

Values

  • <length>Specifies a positive fixed width.
  • <percentage>A percentage with respect to the width of the containing block.
  • inherit

Example

<div class="layer">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div>
.layer { 
   background: #fc3;
   border: 5px solid #000;
   padding: 5px;
   padding-left: 40px;
}

Give it a Try

Click the button below to experiment with this property.

Give it a Try!

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
412113.51
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
≤37184Yes1Yes

Last updated by CSSPortal on: 3rd November 2019