Front-end Tutorials

Front-end Tutorials

HTMLCSSSassJavaScriptReactJS
CMS Tutorials

CMS Tutorials

WordPress
Tutorials expand

CSS Properties

CSS inset-block-end Property

Posted in CSS Tutorial
Updated on Oct 03, 2024
By Mari Selvan
๐Ÿ‘๏ธ 7 - Views
โณ 4 mins
๐Ÿ’ฌ 1 Comment
CSS inset-block-end Property

Photo Credit to CodeToFun

๐Ÿ™‹ Introduction

The inset-block-end property in CSS is a logical property that allows you to control the offset of an element's block-end edge in a flow-relative manner.

This property is part of the Logical Properties and Values specification, which provides a way to write CSS that is adaptable to different writing modes, such as left-to-right, right-to-left, and vertical text layouts.

๐Ÿ’ก Syntax

The syntax for the inset-block-end property is straightforward. You can specify a length, percentage, or auto value.

Syntax
Copied
Copy To Clipboard
element {
  inset-block-end: value;
}

๐ŸŽ›๏ธ Default Value

The default value of the inset-block-end property is auto, which means the element's block-end offset will be determined by the browser's default styling.

๐Ÿ  Property Values

ValueDescription
lengthSpecifies a fixed offset. Can be in units like px, em, rem, etc.
percentageSpecifies an offset as a percentage of the containing block's block size.
autoThe browser calculates the block-end offset automatically.

๐Ÿ“„ Example

In this example, we'll set the inset-block-end property to 20px for a div element.

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-block-end Example</title>
  <style>
    .box {
      position: relative;
      inset-block-end: 20px;
      width: 100px;
      height: 100px;
      background-color: lightcoral;
    }
  </style>
</head>
<body>
  <h1>Div with Custom Block-End Offset</h1>
  <div class="box"></div>
</body>
</html>

๐Ÿ–ฅ๏ธ Browser Compatibility

The inset-block-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-block-end property is a useful tool for web developers looking to create layouts that are adaptable to different writing modes.

By using this logical property, you can ensure that your designs are more flexible and better suited for internationalization. Experiment with different values and see how this property 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