Hurry! Try our new Interactive Courses for FREE. 🥳   🚀

CSS inset-inline-end Property

The inset-inline-end property in CSS is known for defining the logical inline end inset of an element, which gets mapped to the physical offset on the basis of the writing mode, text orientation, and directionality of the element.

This property is a shorthand property for the CSS properties like- inset-inline-end and inset-inline-start properties and the shorthand for these properties is inline-inset. This property takes up the same values as the left property.

Syntax

inset-inline-end: ength|percentage|auto|inherit|initial|unset;

Example 1: CSS inset-inline-end Property

Here in the example below, we are using the inset-inline-end property to position our text inside the container according to the values specified. Here, we have given the inset-inline-end value as 20px. This value acts as the margin for our text to get placed inside the container. Since this is the inset-inline-end property, the text gets positioned 20px halfway outside the box.

<!DOCTYPE html>
<html>
<head>
	<title>The inset-inline-end property in CSS</title>
	<style type="text/css">
		div {
	  background-color: green;
	  width: 120px;
	  height: 120px;
	}	
	.exampleText {
	  writing-mode: vertical-rl;
	  position: relative;
	  inset-inline-end: 20px;
	  background-color: #fc8ffc;
	}
	</style>
</head>
<body>
	<div>
		<p class="exampleText">Study Tonight</p>
	</div>
</body>
</html>

Output

Example 2: CSS inset-inline-end Property

Here in this second example, we have given the inset-inline-end property value as auto. This auto value means the default value of this property by which the text gets positioned at the starting position of the container block.

<!DOCTYPE html>
<html>
<head>
	<title>The inset-inline-end property in CSS</title>
	<style type="text/css">
		div {
	  background-color: red;
	  width: 120px;
	  height: 120px;
	}	
	.exampleText {
	  writing-mode: vertical-rl;
	  position: relative;
	  inset-inline-end: auto;
	  background-color: #fc8ffc;
	}
	</style>
</head>
<body>
	<div>
		<p class="exampleText">Study Tonight</p>
	</div>
</body>
</html>

Output

Live Example

Here in this live example, you can easily test the live coding and execute the example using different values or edit the coding and create your own example.

Browser Compatibility

The term browser compatibility indicates the ability of a particular website to appear fully functional on several browsers, available in the market. This means that the HTML coding of the website and the scripts on that website must be compatible to run on the browsers. It is of immense importance today when there is a large variety of web browsers available.

Name of Browser Background size contain and cover
Chrome 87 87
Edge 79 79
Firefox 63 63
Internet Explorer no no
Opera 73 73
Safari no no
Webview Android 87 87
Chrome Android 87 87
Firefox Android 63 63
Opera Android 48 48
IOS Safari no no
Samsung Internet no no

Conclusion

This property is applicable to the positioned elements. It is not an inherited property. The percentage value refers to the logical width of the containing block. The computed value for this property is the same as box offsets like top, left, right and bottom properties, only the directions are logical.