- Services
- Case Studies
- Technologies
- NextJs development
- Flutter development
- NodeJs development
- ReactJs development
- About
- Contact
- Tools
- Blogs
- FAQ
CSS border-inline-width Manage Logical Border Widths
Use length values, keywords, and global values.
Introduction
The border-inline-width
CSS property lets you define the width of the logical inline borders of an element. This is super useful for making sure your border widths are consistent across different text directions and writing modes. It’s been reliably available since September 2021 and works well across many devices and browsers.
Description
The border-inline-width
property helps you set the width of the logical inline borders of an element. It adapts based on the writing mode, text direction, and orientation of the element. This makes it a versatile tool for ensuring consistent border styles in various layouts.
Syntax
The border-inline-width
property is easy to use. Here’s the basic syntax:
Values
You can use different types of values with border-inline-width
:
Length Values
- Use units like
px
,em
,rem
, etc.
Predefined Keywords
- Use keywords like
thin
,medium
(default), orthick
.
Global Values
- Global values like
inherit
,initial
,revert
,revert-layer
, andunset
.
Examples
Here are some practical examples to show how border-inline-width
works:
Setting Border Width Using Length Values
HTML:
Setting Border Width Using Predefined Keywords
HTML:
Formal Definition
The border-inline-width
property is formally defined to specify the width of the logical inline borders of an element. Here are the key characteristics:
Initial Value | medium |
---|---|
Applies To | All elements |
Inherited | No |
Percentages | Logical width of containing block |
Computed Value | Absolute length; 0 if the border style is none or hidden |
Animation Type | By computed value type |
Specifications
The border-inline-width
property is defined in the CSS Logical Properties and Values Level 1 specification:
- CSS Logical Properties and Values Level 1:
Browser Compatibility
The border-inline-width
property is widely supported across major browsers:
- Google Chrome: Supported
- Microsoft Edge: Supported
- Mozilla Firefox: Supported
- Opera: Supported
- Safari: Supported
For detailed compatibility information, you can refer to the following resources:
Formal Syntax
The formal syntax for the border-inline-width
property defines how you can specify the width of the logical inline borders of an element. Here is the formal syntax for border-inline-width
:
Where <'border-width'>
can be one of the following:
Explanation
- Length Values: You can specify the border width using length units such as
px
,em
,rem
, etc. For example: - Predefined Keywords: You can also use predefined keywords to set the border width:
thin
medium
(default value)thick
For example:
- Global Values: Global values allow you to inherit, reset, or unset the border width:
inherit
: Inherits the border width from the parent element.initial
: Resets the border width to its initial value.revert
: Resets the border width to the user agent’s default.revert-layer
: Resets the border width to the value specified in the nearest ancestor’s cascade layer.unset
: Resets the border width to its inherited value if it is inheritable; otherwise, it resets to the initial value. For example:
By adhering to these formal definitions and syntax, you can ensure that your use of the border-inline-width
property is both accurate and effective, leading to consistent and adaptable border styling in your web projects.
Supported Browsers
The border-inline-width
property is supported by major browsers, including:
Reference
For more detailed information, you can refer to the official documentation:
These examples demonstrate how to use the border-inline-width
property effectively in your CSS, ensuring consistent and adaptable border styling across different writing modes and text directions.
Specifications
The border-inline-width
property is defined in the CSS Logical Properties and Values Level 1 specification. This specification outlines the behavior and syntax of the property, ensuring consistency across different web standards.
Here is the relevant specification for border-inline-width
:
- CSS Logical Properties and Values Level 1:
This specification provides a comprehensive guide on how the border-inline-width
property should be implemented and used, ensuring that web developers can rely on consistent behavior across different browsers and platforms.
By adhering to these specifications, you can ensure that your use of the border-inline-width
property is both accurate and effective, leading to consistent and adaptable border styling in your web projects.
Browser Compatibility
The border-inline-width
property is widely supported across many browsers, making it a reliable choice for web developers and designers. Below is a summary of the browser compatibility for this property:
- Google Chrome: Supported
- Microsoft Edge: Supported
- Mozilla Firefox: Supported
- Opera: Supported
- Safari: Supported
For detailed compatibility information, you can refer to the following resources:
See Also
For further reading and related properties, you can explore the following resources:
- CSS Logical Properties and Values
- Related physical border properties:
- Related properties for writing mode and direction:
These resources provide additional context and tools for working with the border-inline-width
property, helping you create more robust and adaptable web designs.
Help Improve MDN
Was this page helpful to you?
- Yes
- No
This page was last modified on Jul 18, 2023 by MDN contributors.
Report a problem with this content
This section provides additional resources and ways to contribute to the improvement of MDN documentation, ensuring that it remains a valuable resource for web developers and designers.
Talk with CEO
We'll be right here with you every step of the way.
We'll be here, prepared to commence this promising collaboration.
Whether you're curious about features, warranties, or shopping policies, we provide comprehensive answers to assist you.