The padding-inline property is a logical CSS shorthand for inner spacing on the inline-start and inline-end sides of an element. In normal horizontal English layouts, that usually means the left and right padding.
The padding-inline property in CSS is a shorthand property that sets the padding for the inline start and inline end edges of an element. Unlike traditional padding properties, which are based on the physical left and right sides of an element, padding-inline is logical and adapts to the text direction of the document.
This makes it particularly useful for internationalization, as it automatically adjusts for languages that read from right to left.
Definition and Usage
Apply padding-inline when you need horizontal inner spacing that follows the inline axis instead of fixed physical left and right edges. Use a single value for equal inline-start and inline-end padding, or two values when each side needs a different amount.
Like regular padding, padding-inline 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
For a simple left-to-right page, padding-inline: 20px 10px; looks like 20px left padding and 10px right padding. In RTL, those values swap sides automatically so spacing still follows the text flow.
LTR → inline-start is leftRTL → inline-start is right
Foundation
📝 Syntax
The syntax for the padding-inline property allows you to set the padding for the inline start and end in one declaration. You can use either one or two values.
Cards, buttons, text blocks, and RTL-aware horizontal spacing
Defaults
🎯 Default Value
The default value of the padding-inline property is 0, meaning no padding is applied by default.
Reference
💎 Property Values
Value
Example
Description
Length
padding-inline: 20px 10px;
Specifies the padding in fixed units like px, em, or rem.
Percentage
padding-inline: 5%;
Specifies the padding as a percentage of the containing block’s inline size.
auto
padding-inline: auto;
Automatically calculates the padding (rarely used in practice).
initial
padding-inline: initial;
Sets the property to its default value.
inherit
padding-inline: inherit;
Inherits the value from its parent element.
padding-inline: 1.25rem;padding-inline: 20px 10px;padding-inline-start: 1rem;
Preview
👀 Live Preview
Four boxes with the same content and different piln- utility classes showing increasing inline-axis inner spacing:
piln-sm
piln-md
piln-lg
piln-xl
Hands-On
Examples Gallery
Try the reference example with two values, a single-value form, card horizontal spacing, and a logical vs physical padding comparison.
🔢 Basic padding-inline
Start with the reference example — different padding on inline-start and inline-end.
Example 1 — Inline-Start and Inline-End Padding
In this example, we’ll set the padding for an element using the padding-inline property.
padding-inline-example.html
<style>.example{padding-inline:20px10px;background-color:lightgray;}</style><divclass="example">
This box has 20px padding at the start and 10px padding at the end.
</div>
This box has 20px padding at the start and 10px padding at the end.
How It Works
The lightgray background fills the padding area, so you can see 20px space at inline-start and 10px at inline-end. In horizontal LTR English, that is left and right padding.
Example 2 — Single Value
Set equal inline-start and inline-end padding with padding-inline: 1.25rem.
padding-inline adds horizontal breathing room inside this card.
How It Works
Pair padding-inline for horizontal rhythm with padding-block for vertical rhythm. Together they replace physical padding shorthand in logical layouts.
Example 4 — Logical vs Physical Padding
Compare padding-inline with padding-left and padding-right.
padding-inline-logical.css
/* Logical — follows text direction */.logical{padding-inline:24px12px;}/* Physical — fixed to left and right */.physical{padding-left:24px;padding-right:12px;}
In horizontal LTR English, both approaches look the same. padding-inline stays correct when text direction changes to RTL; physical left and right padding does not.
Companion
padding-inline vs padding, padding-block & side properties
The padding shorthand sets all four sides at once using physical edges. Use padding for simple layouts that always use horizontal LTR writing.
padding-block controls block-start and block-end padding (usually top and bottom in English). When you need per-edge inline-axis control, use padding-inline-start, padding-inline-end, or the physical pair padding-left and padding-right.
Improve readability — Text blocks benefit from inline-axis padding so lines do not touch container side edges.
Size touch targets — Pair inline padding with block padding on buttons and links for comfortable tap areas.
Respect text direction — Logical padding keeps spacing correct for RTL and multilingual users.
Do not hide content — Very large inline 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-inline Works
1
The browser finds inline-start and inline-end
Text direction and writing mode decide which physical edges are inline-start and inline-end.
Text direction
2
You set one or two padding values
Write padding-inline: 20px 10px; or a single value for both sides.
CSS rule
3
Browser adds space on inline sides
Padding is inserted between the content edge and the border on inline-start and inline-end.
Box model
=
▦
Adaptable inline-axis spacing
Your layout keeps correct horizontal spacing when text direction changes.
Compatibility
Browser Compatibility
The padding-inline property is supported in most modern browsers, including Chrome, Firefox, Safari, Edge, and Opera. For the best user experience, especially when supporting international audiences, it is recommended to test the property across different browsers and devices.
✓ Baseline · Modern browsers
Logical inline padding in today’s browsers
Chrome, Firefox, Safari, Edge, and Opera support padding-inline in current versions.
96%Modern browser support
Google Chrome69+ · Desktop & Mobile
Full support
Mozilla Firefox41+ · Desktop & Mobile
Full support
Apple Safari12.1+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium
Full support
Opera56+ · Modern versions
Full support
padding-inline property96% supported
Bottom line: Use padding-inline confidently in modern projects. For older browsers, fall back to padding-left and padding-right.
Wrap Up
Conclusion
The padding-inline property is a versatile tool for web developers who need to manage the layout of elements in a way that respects text direction and internationalization.
By using logical properties like padding-inline, you can create more adaptable and user-friendly designs that work well in various language contexts. Experiment with different padding values to see how they can improve the layout and readability of your content.
Use padding-inline for horizontal rhythm in logical layouts
Pair with padding-block for full logical spacing
Prefer rem or em for scalable inline-axis spacing
Use two values when inline-start and inline-end need different amounts
Test in RTL mode for international layouts
❌ Don’t
Confuse padding-inline with margin-inline
Assume padding-inline always means left and right in every writing mode
Forget that percentage padding is based on inline size
Mix logical and physical padding on the same element without reason
Skip fallbacks when supporting very old browsers
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about padding-inline
Use these points when spacing content along the inline axis.
5
Core concepts
↔01
Inline Axis
Start and end sides.
Purpose
002
Default 0
No spacing.
Default
1|203
Shorthand
One or two values.
Syntax
RTL04
Text direction
Adapts logically.
i18n
lr05
Not left/right
Logical vs physical.
Companion
❓ Frequently Asked Questions
The padding-inline property is a shorthand that sets padding on the inline-start and inline-end sides of an element. In horizontal left-to-right writing, those are usually the left and right padding.
The default value is 0, meaning no inline-axis inner spacing is applied unless you set padding-inline explicitly.
padding-left and padding-right always target physical left and right edges. padding-inline follows the text direction, so it stays correct when the document uses RTL languages like Arabic or Hebrew.
Yes. With two values, the first applies to inline-start and the second to inline-end. With one value, both sides use the same padding.
Use padding-inline when building layouts that support multiple languages, RTL text, or logical CSS systems that pair with properties like inline-size and padding-block.