The padding-left property sets inner spacing on the left edge of an element. Padding adds space inside an element, which can help improve the visual layout and readability of your content.
The padding-left property in CSS is used to define the amount of space between the content of an element and its left border. Padding adds space inside an element, which can help improve the visual layout and readability of your content.
This property is part of the CSS box model, which also includes margins, borders, and content.
Definition and Usage
Apply padding-left when you need extra room to the left of the content inside an element — for example, indenting a paragraph, offsetting text beside an icon, or adding space inside a card before the left border.
Like all padding properties, padding-left increases the visible size of an element’s background and border box. It never collapses and always stays inside the element’s border.
💡
Beginner Tip
Use padding-left for inner spacing on the left. Use margin-left when you need space outside the element, between this box and the one to its left.
padding-left → space before contentAlways the physical left edge
Foundation
📝 Syntax
The syntax for the padding-left property is simple. You specify the padding value directly within the CSS rule for the desired element.
syntax.css
element{padding-left:value;}
Here, value can be specified in different units such as pixels (px), ems (em), percentages (%), or other valid CSS units.
Basic Example
padding-left.css
p{padding-left:20px;border:1px solid #000;}
Syntax Rules
Apply padding-left to any element that needs extra inner space on the left side.
The value is a length, percentage, or keyword such as inherit or initial.
The property is not inherited — child elements do not automatically get the parent’s left padding.
Percentage padding is calculated relative to the width of the containing block.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Initial value
0
Applies to
Left padding side only
Inherited
No
Animatable
Yes, as a length
Common use
Paragraphs, lists, cards, and indented content beside icons
Defaults
🎯 Default Value
The default value for the padding-left property is 0. This means that if no value is specified, there will be no extra space between the content and the left border of the element.
Reference
💎 Property Values
Value
Example
Description
Length
padding-left: 10px;
Defines a fixed amount of padding using units like px, em, or rem.
Percentage
padding-left: 5%;
Defines the padding as a percentage of the containing element’s width.
inherit
padding-left: inherit;
Inherits the padding value from the parent element.
Four boxes with the same content and different pl- utility classes showing increasing left inner spacing:
pl-sm
pl-md
pl-lg
pl-xl
Hands-On
Examples Gallery
Start with the reference paragraph example, try different left values, add indent spacing in lists, and compare physical left padding with logical inline-start padding.
🔢 Basic padding-left
Start with the reference example — left padding on a paragraph with a border.
Example 1 — Paragraph with Left Padding
In this example, we’ll add a left padding of 20 pixels to a paragraph element.
padding-left-example.html
<style>p{padding-left:20px;border:1px solid #000;}</style><p>
This paragraph has a left padding of 20 pixels, which adds space between the content and the left border.
</p>
Each class sets a different left padding while leaving the right side unchanged. The background fills the padding area so you can compare the spacing visually.
🛠 Layout Patterns
Apply left padding to lists and compare physical vs logical properties.
Example 3 — List Item Indent
Add left padding to list items for a custom indented look without default bullets.
In horizontal LTR English, both approaches look the same. padding-inline-start stays correct when text direction changes to RTL; physical left padding does not.
Companion
padding-left vs padding, padding-inline-start & margin-left
The padding shorthand sets padding on all four sides at once. Use padding-left when you need spacing on only the left edge.
padding-inline-start is the logical equivalent that follows the inline axis. Use padding-left for simple physical layouts; prefer padding-inline-start in multilingual or RTL designs. Remember: margin-left adds space outside the border, not inside it.
padding-left-companion.css
/* Left only */.quote{padding-left:1.25rem;border-left:4px solid #2563eb;}/* All four sides via shorthand */.card{padding:1rem1.5rem;}/* Space to the left outside the border */.sidebar{margin-left:2rem;}
A11y
♿ Accessibility
Improve readability — Paragraphs and list items benefit from left padding so text does not crowd the left border.
Touch targets — Buttons and links inside padded containers are easier to tap when left padding gives them room.
RTL layouts — For multilingual sites, consider padding-inline-start instead of padding-left so spacing follows text direction.
Do not hide content — Very large left padding on small screens can squeeze readable text area.
Test zoomed layouts — Users who zoom in rely on comfortable padding to keep text readable.
🧠 How padding-left Works
1
You set a padding value
Write padding-left: 20px; with a length, percentage, or keyword.
CSS rule
2
Browser adds space on the left
Padding is inserted between the content edge and the border on the left side only.
Box model
3
Background fills the padding area
The element’s background color and background image extend into the padding box, making the gap visible.
Rendering
=
▦
Comfortable left spacing
Content has breathing room before it without affecting spacing on other sides or outside the border.
Compatibility
Browser Compatibility
The padding-left property is supported in all modern browsers, including Chrome, Firefox, Safari, Edge, and Opera. It is also compatible with older versions of these browsers, ensuring consistent behavior across different platforms.
✓ Universal · All browsers
Left padding works everywhere
Chrome, Firefox, Safari, Edge, Opera, and Internet Explorer all support padding-left as a core box-model property.
100%Universal support
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Legacy & Chromium
Full support
OperaAll versions
Full support
padding-left property100% supported
Bottom line:padding-left is one of the most reliable CSS properties. Safe to use in any project without fallbacks.
Wrap Up
Conclusion
The padding-left property is an essential tool for web developers looking to control the spacing within their elements.
By adjusting the left padding, you can create visually appealing layouts that enhance the user experience. Experiment with different padding values and units to see how they can improve the design of your web projects.
Use padding-left for inner spacing on the left in LTR layouts
Prefer rem or em for scalable left spacing
Pair with border-left for quote and accent styles
Use the padding shorthand when all sides need spacing
Consider padding-inline-start for RTL-aware international layouts
❌ Don’t
Confuse padding-left with margin-left for outer spacing
Use excessive left padding that pushes content off small screens
Forget that percentage padding is based on width, not height
Rely on padding-left alone in RTL multilingual layouts
Use physical left padding when writing-mode-aware layouts need logical properties
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about padding-left
Use these points when spacing content on the left edge.
5
Core concepts
←01
Left Only
One physical edge.
Purpose
002
Default 0
No spacing.
Default
▦03
Inside Border
Part of box model.
Scope
%04
Units
px, em, rem, %.
Values
pis05
Not inline-start
Physical vs logical.
Companion
❓ Frequently Asked Questions
The padding-left property sets inner spacing on the left edge of an element, between the content and the left border. It creates horizontal room before the content inside the element.
The default value is 0, meaning no left inner spacing is applied unless you set padding-left explicitly.
padding-left adds space inside the element, between the content and the border. margin-left adds space outside the border, between this element and the element to its left.
padding-left always targets the physical left edge. padding-inline-start follows the inline axis and stays correct when text direction changes to RTL.
Yes. Percentage padding is calculated relative to the width of the containing block, even for left padding.