- Services
- Case Studies
- Technologies
- NextJs development
- Flutter development
- NodeJs development
- ReactJs development
- About
- Contact
- Tools
- Blogs
- FAQ
CSS border-block-start-width A Comprehensive Guide
Introduction
The border-block-start-width
property in CSS sets the width of the logical block-start border of an element. This property adapts to the element’s writing mode, directionality, and text orientation, making it useful for responsive design. It corresponds to the border-top-width
, border-right-width
, border-bottom-width
, or border-left-width
property, depending on the text orientation and direction.
Baseline Widely Available
The border-block-start-width
property has been widely supported since September 2021. For detailed compatibility information, refer to the Browser Compatibility section.
Description
The border-block-start-width
CSS property sets the width of the logical block-start border of an element. This border corresponds to the top, right, bottom, or left border, depending on the element’s writing mode, directionality, and text orientation. This property helps create visually appealing and responsive designs, adapting to different layouts and text directions.
Syntax
Explanation
<border-width>
values: Specify the border width using lengths (e.g.,5px
) or keywords likethin
,medium
, andthick
.- Global values: Include
inherit
,initial
,revert
,revert-layer
, andunset
.
Values
The border-block-start-width
property accepts values that define the width of the logical block-start border.
<border-width>
- Length values: Specify the border width using units like pixels (
px
), ems (em
), or percentages (%
). - Predefined keywords:
thin
,medium
,thick
.
Global Values
inherit
: Inherits the value from the parent element.initial
: Resets the property to its initial value (medium
).revert
: Resets the property to the user agent’s default value.revert-layer
: Resets the property to the value established by the user-agent stylesheet or the user stylesheet.unset
: Resets the property to its inherited value if it inherits, or to its initial value if it does not.
Formal Definition
Property | Value |
---|---|
Initial value | medium |
Applies to | All elements |
Inherited | No |
Percentages | Refers to the logical width of the containing block |
Computed value | Absolute length; 0 if the border style is none or hidden |
Animation type | By computed value type |
Formal Syntax
Explanation
<line-width>
: Defines the border width using a length value or keywords.<length>
: Represents a length value (e.g.,5px
,2em
,10%
).thin
: Sets the border width to thin.medium
: Sets the border width to medium (default).thick
: Sets the border width to thick.
Examples
Basic Usage
Using Predefined Keywords
Vertical Text with border-block-start-width
Specifications
The border-block-start-width
property is defined in the CSS Logical Properties and Values Level 1 specification.
Key Specification
- CSS Logical Properties and Values Level 1: Includes detailed information about the
border-block-start-width
property. Refer to the CSS Logical Properties and Values Level 1 document for comprehensive details.
Browser Compatibility
The border-block-start-width
property is widely supported across modern web browsers.
Supported Browsers
- Chrome: Supported since version 69.
- Firefox: Supported since version 41.
- Opera: Supported since version 56.
- Edge: Supported since version 79.
- Safari: Supported since version 12.1.
Browser Compatibility Data Tables
For detailed compatibility information, refer to resources like MDN Web Docs and Can I Use.
Tips for Ensuring Compatibility
- Check for Feature Support: Use tools like Can I Use to check for the support of the
border-block-start-width
property in different browsers. - Fallback Styles: Implement fallback styles to ensure functionality in unsupported browsers.
- Test Across Browsers: Always test your web design across multiple browsers and versions.
See Also
Related CSS Properties
border-block-end-width
: Defines the width of the logical block-end border.border-inline-start-width
: Defines the width of the logical inline-start border.border-inline-end-width
: Defines the width of the logical inline-end border.
Related Specifications
- CSS Logical Properties and Values: Overview of CSS logical properties and values.
Related Physical Border Properties
border-top-width
: Defines the width of the top border.border-right-width
: Defines the width of the right border.border-bottom-width
: Defines the width of the bottom border.border-left-width
: Defines the width of the left border.
Related Writing Mode Properties
writing-mode
: Defines the writing mode of an element.direction
: Defines the text direction of an element.text-orientation
: Defines the orientation of text within an element.
Additional Resources
- MDN Web Docs: Comprehensive resource for learning about CSS.
- Can I Use: Tool for checking CSS property compatibility.
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.