CSS border-block-start attribute

Definition and Usage

border-block-start The attribute is an abbreviation of the following properties:

CSS border-block-start properties are related to border-bottom,border-left,border-right and border-top The attribute is very similar, but border-block-start The attribute depends on the block direction.

Note:related CSS properties writing-mode Defines the block direction. This affects the start and end positions of the block, as well as border-block-start The result of the attribute. For English pages, the inline direction is from left to right, and the block direction is downward.

Instance

Example 1

Set the border width, color, and style at the start of the block direction:

div {
  border-block-start: 10px solid pink;
}

Try it yourself

Example 2: Combined with the writing-mode attribute

The position of the border at the start of the block direction is affected by writing-mode The impact of the attribute:

div {
  writing-mode: vertical-rl;
  border-block-start: dotted blue;
}

Try it yourself

CSS syntax

border-block-start: border-block-start-width border-block-start-style border-block-start-color|initial|inherit;

Attribute value

Value Description
border-block-start-width

Specifies the border width at the start of the block direction for the element.

The default value is medium.

border-block-start-style

Specifies the border style at the start of the block direction for the element.

The default value is none.

border-block-start-color

Specifies the border color at the start of the block direction for the element.

The default value is the current border color.

initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical details

Default value: medium none currentcolor
Inheritance: No
Animation creation: Supported. See:Animation-related properties.
Version: CSS3
JavaScript syntax: object.style.borderBlockStart="pink dotted 5px"

Browser support

The numbers in the table represent the first browser version to fully support this property.

Chrome Edge Firefox Safari Opera
69.0 79.0 41.0 12.1 56.0

Related pages

Tutorial:CSS Border

Reference:CSS border attribute

Reference:CSS border-block attribute

Reference:CSS border-block-color attribute

Reference:CSS border-block-start-color attribute

Reference:CSS border-bottom-color attribute

Reference:CSS border-left-color property

Reference:CSS border-right-color property

Reference:CSS border-top-color property

Reference:CSS writing-mode attribute