Front-end Tutorials

Front-end Tutorials

HTMLCSSSassJavaScriptReactJS
CMS Tutorials

CMS Tutorials

WordPress
Tutorials expand

CSS Properties

CSS inset-inline-end Property

Posted in CSS Tutorial
Updated on Oct 03, 2024
By Mari Selvan
👁️ 8 - Views
⏳ 4 mins
💬 1 Comment
CSS inset-inline-end Property

Photo Credit to CodeToFun

🙋 Introduction

The inset-inline-end property in CSS is a logical property that defines the offset of an element's end edge in the inline direction within its containing block. Logical properties and values are writing-mode-aware, meaning they can adapt to different writing directions, such as left-to-right (LTR) and right-to-left (RTL).

This property is part of the CSS Logical Properties and Values Level 1 specification, which aims to provide more flexibility in styling for internationalization and different writing modes.

💡 Syntax

The syntax for the inset-inline-end property is as follows:

Syntax
Copied
Copy To Clipboard
element {
  inset-inline-end: length | auto | initial | inherit;
}

🎛️ Default Value

The default value of the inset-inline-end property is auto.

🏠 Property Values

ValueDescription
lengthSpecifies a fixed offset from the end edge. Can be any valid length value (e.g., px, em, rem).
autoThe browser calculates the offset.
initialSets the property to its default value.
inheritInherits the value from its parent element.

📄 Example

In this example, we'll set the inset-inline-end property of a positioned element to 20px to offset it 20 pixels from the end edge in the inline direction.

index.html
Copied
Copy To Clipboard
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>CSS inset-inline-end Example</title>
  <style>
    .box {
      position: absolute;
      inset-inline-end: 20px;
      top: 50px;
      width: 100px;
      height: 100px;
      background-color: lightcoral;
    }
  </style>
</head>
<body>
  <h1>Element with Custom Inset-inline-end</h1>
  <div class="box"></div>
</body>
</html>

🖥️ Browser Compatibility

The inset-inline-end property is supported in most modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. However, it is always a good practice to test your website across different browsers to ensure compatibility.

🎉 Conclusion

The inset-inline-end property is a useful tool for web developers looking to create layouts that adapt to different writing modes and directions.

By using logical properties, you can ensure your designs are more flexible and better suited for internationalization. Experiment with this property to see how it can enhance the responsiveness and adaptability of your web projects.

👨‍💻 Join our Community:

To get interesting news and instant updates on Front-End, Back-End, CMS and other Frameworks. Please Join the Telegram Channel:

Author

author
👋 Hey, I'm Mari Selvan

For over eight years, I worked as a full-stack web developer. Now, I have chosen my profession as a full-time blogger at codetofun.com.

Buy me a coffee to make codetofun.com free for everyone.

Buy me a Coffee

Share Your Findings to All

Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
We make use of cookies to improve our user experience. By using this website, you agree with our Cookies Policy
AgreeCookie Policy