CSS padding-inline Property
Description
The padding-inline property controls the padding on an element's inline-start and inline-end edges — in other words, the padding that runs along the inline axis of the current writing mode. Because it is a logical property, the specific physical sides it affects depend on the element's typography: it maps to left/right in a horizontal left-to-right flow, to right/left in an RTL flow, and to top/bottom in vertical flows. This makes it a convenient way to express spacing that automatically adapts to different scripts and orientations; see writing-mode and direction for the layout decisions that determine that mapping.
In the box model the inline padding contributes to the element’s padding area and therefore influences layout, hit testing, and background painting in the same way physical padding properties do. It does not collapse like margins can, and it becomes part of the space that affects an element’s used size and how its contents are positioned. Because that used size can be interpreted differently when the sizing model changes, it interacts with box-sizing. You can still target the equivalent physical edges when needed — for example with padding-left and padding-right — but using the logical property avoids switching between left/right when supporting different writing directions.
Practical use cases for padding-inline include creating bidirectional-safe horizontal spacing, authoring layouts that work with vertical text flows, and keeping style rules simpler and more maintainable across internationalized interfaces. It pairs naturally with other logical properties when you want consistent semantics along the inline axis; for example, you might use it together with margin-inline to manage external spacing or with inset-inline to control inline offsets. Choosing logical properties over physical ones reduces the number of conditional rules needed for RTL or vertical text support.
Definition
- Initial value
- See individual properties
- Applies to
- all elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column
- Inherited
- no
- Computed value
- See individual properties
- Animatable
- a length
- JavaScript syntax
- object.style.paddingInline
Interactive Demo
Syntax
padding-inline: <padding-top>{1,2}
Values
- <padding-top>{1,2} Specifies distance in px, pt, cm, etc. Negative values are not allowed.
Example
Browser Support
The following information will show you the current browser support for the CSS padding-inline property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
