- Services
- Case Studies
- Technologies
- NextJs development
- Flutter development
- NodeJs development
- ReactJs development
- About
- Contact
- Tools
- Blogs
- FAQ
CSS Padding-Inline Flexible Text Padding
Learn use cases, syntax, and options for this versatile CSS property.
Optimize your web design.
Introduction
The padding-inline
CSS property sets the padding at the start and end of an element’s inline direction. It’s useful for creating flexible designs that adapt to different text directions and writing modes. This property has been widely supported since September 2021.
Specification
The padding-inline
property is part of the CSS Logical Properties and Values Level 1 specification. You can find more details in the official documentation:
Description
The padding-inline
property lets you set the padding at the start and end of an element’s inline direction. This is handy for making designs that adapt to the text’s writing mode, direction, and orientation. It’s a shorthand for padding-inline-start
and padding-inline-end
.
Syntax
You can use one or two values with padding-inline
:
- One value: Applies the same padding to both the start and end.
- Two values: The first value is for the start, and the second is for the end.
Values
The padding-inline
property accepts the following values:
<length>
: Fixed value (e.g.,10px
,1em
).<percentage>
: Relative to the inline size of the containing block (e.g.,5%
).- Global values:
inherit
,initial
,revert
,revert-layer
,unset
.
Constituent Properties
The padding-inline
property combines two properties:
padding-inline-start
: Padding at the start of the inline direction.padding-inline-end
: Padding at the end of the inline direction.
Using padding-inline
, you can set both properties at once:
Examples
Horizontal Text
HTML:
CSS:
Vertical Text
HTML:
CSS:
Using Percentage Values
HTML:
CSS:
Using a Single Value
HTML:
CSS:
Browser Compatibility
The padding-inline
property is supported in most modern browsers:
- Google Chrome: Version 87 and later
- Microsoft Edge: Version 87 and later
- Mozilla Firefox: Version 66 and later
- Opera: Version 73 and later
- Safari: Version 14.1 and later
For the most up-to-date information, check the MDN documentation:
See Also
For more information, you might find these topics useful:
- CSS Logical Properties and Values: Learn more about logical properties.
- Mapped Physical Properties: Understand the physical padding properties.
- Writing Mode, Direction, and Text Orientation: Learn about properties that define text direction.
Talk with CEO
We'll be right here with you every step of the way.
We'll be here, prepared to commence this promising collaboration.
Whether you're curious about features, warranties, or shopping policies, we provide comprehensive answers to assist you.