Tutorials

CSS 'border-block-end' Property Explained

  • Published
  • 2 min read
  • CSS
  • HTML
  • Web Design
CSS 'border-block-end' Property Explained
In this article
  1. CSS 'border-block-end' Property Examples
  2. Browser Support For 'border-block-end' Property
  3. CSS Syntax of the 'border-block-end' Property
  4. Usage of the 'border-block-end' Property
  5. Property Values of the 'border-block-end' Property

Corrected . The vertical writing-mode mapping was corrected: block-end is the left border in vertical-rl and the right border in vertical-lr (checked against MDN border-block-end). Editorial approval is still pending.

The CSS 'border-block-end' property is a shorthand that allows you to set the width, style, and color of the border at the block-end of an element in a single declaration. This property is part of CSS Logical Properties and adapts to the writing mode of the document or element, making it especially useful in internationalized content where the direction of text may change.

CSS 'border-block-end' Property Examples

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

The 'border-block-end' property enhances the flexibility and adaptability of CSS for internationalization by providing logical, writing-mode-aware control over element borders, supporting the creation of more accessible and globally friendly web designs.

Browser Support For 'border-block-end' Property

firefoxsafarichromemicrosoft edgeopera
41.012.169.079.056.0

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

/* width, style and color can be given in any order; each is optional */
border-block-end: <line-width> || <line-style> || <color>;

border-block-end: 3px solid navy;   /* horizontal-tb: bottom border */
border-block-end: dashed;           /* omitted width and color use medium and currentcolor */

Usage of the 'border-block-end' Property

Use 'border-block-end' to style the border that appears at the end of an element's block flow. This border is the bottom border in horizontal writing modes (horizontal-tb, like English). In vertical writing modes it depends on the mode: with writing-mode: vertical-rl (the usual mode for traditional Japanese, where successive lines move right to left) block-end is the left border, and with writing-mode: vertical-lr block-end is the right border. It's particularly handy for creating consistent designs across different languages and writing systems, ensuring that the border styling is logical and adapts to the flow of content.

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

  • Width: Specifies the thickness of the border. It can be given in pixels (px), ems (em), or keywords (thin, medium, thick). The default is medium.
  • Style: Determines the border style (none, hidden, solid, dotted, dashed, double, groove, ridge, inset, outset). The default is none, which draws no border.
  • Color: Sets the color of the border. It can be any valid CSS color value, like a named color, HEX, RGB, RGBA, HSL, or HSLA. The default is currentcolor (the element's text color).
  • Initial: Resets the 'border-block-end' to its default values (medium, none, currentcolor), which means no border is drawn.
  • Inherit: Inherits the 'border-block-end' settings from the parent element.

Share this article

Written by

Webzstore Team

Webzstore has helped businesses since 2010. Today, we bring websites, digital marketing and enquiry follow-up into practical plans built around the work each business needs.

Related services

Talk about your website or marketing

Book a Free 30-Minute Call

More tutorials

All tutorials

Privacy choices

Choose what this website may load. Your choice is saved on this device for up to 180 days. Privacy Policy

Turning a choice off stops further use of that optional service on this site. It does not take back information already sent, and we cannot delete cookies that other services set in your browser.