Contact Us | +1 888 239-0733 (Toll free US/CA) Mon-Fri: 7:30am to 4:30pm (PST)

CSS 'border-block-color' Property Explained

Est. Reading: 1 minute
Posted: April 1, 2024

The CSS 'border-block-color' property sets the color of an element's block-start and block-end borders. It's part of the CSS Logical Properties, which provide a way to style elements based on their logical, rather than physical, dimensions and directions. This property is especially useful in designs and layouts that need to adapt to different writing modes and directions, such as those used in internationalized websites.

CSS 'border-block-color' Property Examples

See the Pen CSS 'border-block-color' Property by Webzstore (@webzstore) on CodePen.

The 'border-block-color' property is essential for designing adaptable and responsive web interfaces. Allowing border colors to be logically defined along the block axis supports the creation of layouts that work seamlessly across different writing modes, enhancing the global usability and accessibility of web content.

Browser Support For 'border-block-color' Property

FirefoxSafariChromeMicrosoft EdgeOpera
66.014.187.087.073.0

CSS Syntax of the 'border-block-color' Property

border-block-color: color | initial | inherit ;

Usage of the 'border-block-color' Property

Use 'border-block-color' to specify the color of the borders at the block-start and block-end of an element. This can help maintain a consistent design across languages and writing modes by ensuring that border colors adapt to the orientation of the content. It's particularly beneficial in responsive design and content that must support multiple languages and writing systems.

Property Values of the 'border-block-color' Property

  • Color: This specifies the color of the block-start and block-end borders. It can be defined using named colors, HEX codes, RGB(a), and HSL(a) values.
  • Initial: Resets the 'border-block-color' to its default value.
  • Inherit: Inherits the 'border-block-color' from the element's parent.

chevron-down