Front-end Tutorials

Front-end Tutorials

HTMLCSSSassJavaScriptReactJS
CMS Tutorials

CMS Tutorials

WordPress
Tutorials expand

CSS Topics

CSS border-inline-end Property

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

Photo Credit to CodeToFun

🙋 Introduction

The border-inline-end property in CSS is part of the Logical Properties and Values module. It allows you to define the border on the end side of an element's inline dimension, which adapts depending on the text direction (left-to-right or right-to-left).

This property is useful for creating layouts that are responsive to different writing modes, such as languages that use right-to-left text.

💡 Syntax

The syntax for the border-inline-end property is similar to other border properties. It allows you to set the width, style, and color of the border on the inline-end side of an element.

Syntax
Copied
Copy To Clipboard
element {
  border-inline-end: width style color;
}

🎛️ Default Value

The default value of the border-inline-end property is medium none currentcolor. This means that by default, the border is not visible unless explicitly defined.

🏠 Property Values

ValueDescription
widthSpecifies the thickness of the border. Can be set using units like px, em, rem, or keywords like thin, medium, and thick.
styleDefines the style of the border, such as solid, dashed, dotted, double, etc.
colorSets the color of the border. Can be defined using named colors, hexadecimal values, RGB values, HSL values, or currentcolor.

📄 Example

In this example, we'll add a solid, red border to the inline-end side of 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 border-inline-end Example</title>
  <style>
    div {
      border-inline-end: 4px solid red;
    }
  </style>
</head>
<body>
  <h1>Div with border-inline-end</h1>
  <div>This div has a red border on the inline-end side.</div>
</body>
</html>

🖥️ Browser Compatibility

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

🎉 Conclusion

The border-inline-end property is a versatile tool for creating borders that adapt to different text directions and writing modes. It is particularly useful for websites that need to support multiple languages or layouts that change based on the writing mode. By using logical properties like border-inline-end, you can ensure your designs are more flexible and responsive.

👨‍💻 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