Front-end Tutorials

Front-end Tutorials

HTMLCSSSassJavaScriptReactJS
CMS Tutorials

CMS Tutorials

WordPress
Tutorials expand

CSS Topics

CSS border-inline-width Property

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

Photo Credit to CodeToFun

🙋 Introduction

The border-inline-width property in CSS is used to set the width of the inline borders of an element. Inline borders refer to the borders on the start and end sides of an element, which correspond to the left and right sides in left-to-right (LTR) writing modes, and the right and left sides in right-to-left (RTL) writing modes.

This property allows for more precise control of border styling in multi-directional text layouts.

💡 Syntax

The syntax for the border-inline-width property can be as follows:

Syntax
Copied
Copy To Clipboard
element {
  border-inline-width: value;
}

Here, value can be a single width value that applies to both inline borders, or two width values where the first value applies to the start border and the second to the end border.

🎛️ Default Value

The default value of the border-inline-width property is medium, which is a predefined CSS keyword representing a medium border width. The actual pixel value of medium can vary between browsers but is typically around 3 to 4 pixels.

🏠 Property Values

ValueDescription
lengthA specific width value, such as 2px, 0.5em, 1rem, etc.
thinA predefined keyword for a thin border width, typically around 1px.
mediumA predefined keyword for a medium border width, typically around 3px.
thickA predefined keyword for a thick border width, typically around 5px.

📄 Example

In this example, we'll set the inline border width of a box element to 5 pixels on both sides.

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-width Example</title>
  <style>
    .box {
      border-inline-width: 5px;
      border-inline-style: solid;
      border-inline-color: black;
    }
  </style>
</head>
<body>
  <h1>Box with Custom Inline Border Width</h1>
  <div class="box">
    This is a box with 5px inline borders.
  </div>
</body>
</html>

🖥️ Browser Compatibility

The border-inline-width property is well-supported in modern browsers, including Chrome, Firefox, Safari, Edge, and Opera. However, it's recommended to test this property across different browsers and devices to ensure consistent rendering.

🎉 Conclusion

The border-inline-width property provides a flexible way to control the inline borders of an element, which is particularly useful in multi-language websites with different text directions. By customizing the inline border width, you can create visually distinct and responsive designs that adapt to various writing modes and layouts.

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