- Services
- Case Studies
- Technologies
- NextJs development
- Flutter development
- NodeJs development
- ReactJs development
- About
- Contact
- Tools
- Blogs
- FAQ
Understanding CSS padding-inline-start for Responsive Design
Explore its use cases, available options, and compatibility.
Introduction
The padding-inline-start
CSS property adds padding to the start of an element’s inline axis, adapting to different writing modes and text orientations. This makes your designs more flexible and responsive.
Description
The padding-inline-start
property defines the padding at the logical start of an element’s inline axis. Unlike traditional padding properties, it adapts to different writing modes, directions, and text orientations.
In a left-to-right language like English, padding-inline-start
is equivalent to padding-left
. In a right-to-left language like Arabic, it’s equivalent to padding-right
. This property works with other logical padding properties to provide comprehensive control over an element’s padding.
Syntax
The padding-inline-start
property is easy to use. Here’s the basic syntax:
The value
can be:
- Length values: Absolute (
px
) or relative (em
). - Percentage value: Relative to the width of the containing block.
- Global values: Inheritance and reset values (
inherit
,initial
,revert
,revert-layer
,unset
).
Values
The padding-inline-start
property can take several types of values:
Length Values
- Absolute Lengths:
- Relative Lengths:
Percentage Value
Global Values
- Inherit: Inherits the value from the parent element.
- Initial: Resets to the default value.
- Revert: Reverts to the user agent stylesheet value.
- Revert-layer: Reverts to the value defined in the previous layer.
- Unset: Resets to the inherited value if inheritable, otherwise to the initial value.
Formal Definition
- Initial Value:
0
- Applies To: All elements except certain table-related elements.
- Inherited: No
- Percentages: Refers to the logical width of the containing block.
- Computed Value: As
<length>
- Animation Type: A length
Formal Syntax
Examples
Basic Usage
HTML:
CSS:
Result: The text will have a 20px padding at the start of its inline axis.
Vertical Text
HTML:
CSS:
Result: The text will be displayed vertically with a 20px padding at the start of its inline axis.
Right-to-Left Language
HTML:
CSS:
Result: The Arabic text will have a 20px padding at the start of its inline axis.
Specifications
The padding-inline-start
property is defined in the CSS Logical Properties and Values Level 1 specification. This specification outlines how logical properties work with writing modes, directionality, and text orientation.
Specification Document:
- [CSS Logical Properties and Values Level 1]WebsiteUrl
Browser Compatibility
The padding-inline-start
property is widely supported across modern browsers:
- Google Chrome: Supported since version 87.
- Microsoft Edge: Supported since version 87.
- Mozilla Firefox: Supported since version 41.
- Opera: Supported since version 73.
- Safari: Supported since version 12.1.
See Also
To learn more and explore related properties and concepts, check out:
-
CSS Logical Properties and Values: Discover how logical properties enhance web design flexibility.
- [CSS Logical Properties and Values]WebsiteUrl
-
Mapped Physical Properties: Understand how logical properties map to traditional physical properties:
- [
padding-top
]WebsiteUrl - [
padding-right
]WebsiteUrl - [
padding-bottom
]WebsiteUrl - [
padding-left
]WebsiteUrl
- [
-
Related CSS Properties: Explore other CSS properties that define writing modes, directionality, and text orientation:
- [
writing-mode
]WebsiteUrl - [
direction
]WebsiteUrl - [
text-orientation
]WebsiteUrl
- [
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.