CSS border-block Property
Description
The border-block property is part of the logical properties in CSS, which allow developers to define styles relative to the writing mode of the document rather than fixed physical directions like top, right, bottom, and left. Specifically, border-block is a shorthand property that sets both the border-block-start and border-block-end properties simultaneously. This means it controls the borders on the start and end edges of a block in the flow of content, which can vary depending on whether the text direction is left-to-right, right-to-left, horizontal, or vertical. By using border-block, designers can ensure consistent styling across different writing modes without manually adjusting each edge.
One of the key advantages of border-block is its adaptability in internationalization and responsive design. For example, when a page switches from a horizontal left-to-right layout to a vertical or right-to-left layout, the visual appearance of block borders remains logical and consistent, avoiding the need to redefine borders for each orientation. This logical approach simplifies styling for multilingual websites and components that may be reused in various layouts. It can also be particularly useful in dynamic content areas like articles, cards, or tables, where borders need to follow the block flow rather than fixed directions.
Additionally, border-block interacts seamlessly with other border-related properties, such as border for shorthand control over all borders, or individual properties like border-width, border-style, and border-color. While border-block itself only affects the block-start and block-end edges, it inherits the flexibility of these sub-properties, allowing for varied border widths, dashed or solid styles, and color customizations. Using border-block can reduce redundancy in CSS and make code easier to maintain, while also providing better semantic clarity since the borders reflect the structure of the content rather than arbitrary physical directions.
Definition
- Initial value
- See individual properties
- Applies to
- all elements
- Inherited
- no
- Computed value
- See individual properties
- Animatable
- See individual properties
- JavaScript syntax
- object.style.borderBlock
Interactive Demo
Border Block Property
Syntax
border-block: <border-block-width> <border-block-style> <border-block-color>
Values
- <border-block-width>Specifies the width of the border
- <border-block-style>Specifies the style of the border
- <border-block-color>Specifies the color of the border
Example
Browser Support
The following information will show you the current browser support for the CSS border-block property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
