CSS inset-inline Property
Description
The CSS inset-inline
property sets the distance between an element and its parent element in the inline direction. The inline direction is determined by the element's writing-mode and direction properties. For pages in English, the inline direction is left to right. The inset-inline
property is a shorthand property for the inset-inline-start and inset-inline-end properties. The inset-inline-start property sets the distance between the start of the element and its parent element, and the inset-inline-end property sets the distance between the end of the element and its parent element. The inset-inline
property can be set to one or two values. If the property is set to one value, that value will be applied to both the start and end of the element. If the property is set to two values, the first value will be applied to the start of the element and the second value will be applied to the end of the element.
- Initial value
- See individual properties
- Applies to
- positioned elements
- Inherited
- no
- Computed value
- See individual properties
- Animatable
- See individual properties
- JavaScript syntax
- object.style.insetInline
Interactive Demo
Syntax
inset-inline: <top>{1,2}
Values
- <top>{1,2} The first value represents the start edge style, and the second value represents the end edge style. If only one value is given, it applies to both the start and end edges.
Example
<div>
<p class="exampleText">Example text</p>
</div>
div {
background-color: yellow;
width: 120px;
height: 120px;
}
.exampleText {
writing-mode: vertical-lr;
position: relative;
inset-inline: 20px 50px;
background-color: #c8c800;
}
Browser Support
The following table will show you the current browser support for the CSS inset-inline
property.
Desktop | |||||
87 | 87 | 63 | 73 | 14.1 |
Tablets / Mobile | |||||
87 | 63 | 62 | 14.5 | 14 | 87 |
Last updated by CSSPortal on: 2nd January 2024