CSS border-block-style attribute

Definition and usage

border-block-style The attribute sets the border style of the element in the block direction.

border-block-style The value of the attribute can be set in different ways:

If border-block-style The attribute has two values:

border-block-style: dashed dotted;
  • The border style at the beginning of the block is dashed
  • The border style at the end of the block is dot-dashed

If border-block-style The attribute has one value:

border-block-style: dashed;
  • The border style at the beginning and end of the block is dashed

CSS border-block-style attribute and CSS attribute border-bottom-styleborder-left-styleborder-right-style and border-top-style Very similar, but border-block-style The attribute depends on the block direction.

Note:related CSS properties writing-mode Defines the block direction. This affects the starting and ending positions of the block, as well as border-block-style 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 style in the block direction:

#example1 {
  border-block-style: solid;
}
#example2 {
  border-block-style: dashed dotted;
}

Try it yourself

Example 2: Combined with the writing-mode attribute

The position of the border style at the start and end of the block direction is affected by writing-mode Attribute effect:

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

Try it yourself

CSS syntax

border-block-style: none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|initial|inherit;

Attribute value

Value Description
none Default value. Specifies no border.
hidden Same as none, except when resolving border conflicts in table elements.
dotted Specifies a dot line border.
dashed Specifies a dashed line border.
solid Specifies a solid line border.
double Specifies a double-line border.
groove

Specifies a 3D grooved border.

The effect depends on the value of border-color.

ridge

Specifies a 3D raised border.

The effect depends on the value of border-color.

inset

Specifies a 3D inset border.

The effect depends on the value of border-color.

outset

Specifies a 3D convex border.

The effect depends on the value of 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: none
Inheritance: No
Animation creation: Not supported. See:Animation-related properties.
Version: CSS3
JavaScript syntax: object.style.borderBlockStyle="dotted"

Browser support

The numbers in the table represent the browser version that first fully supports this property.

Chrome Edge Firefox Safari Opera
87.0 87.0 66.0 14.1 73.0

Related pages

Tutorial:CSS Borders

Reference:CSS border attribute

Reference:CSS border-block attribute

Reference:CSS border-block-end-style attribute

Reference:CSS border-block-start-style attribute

Reference:CSS border-bottom-style attribute

Reference:CSS border-left-style property

Reference:CSS border-right-style property

Reference:CSS border-top-style property

Reference:CSS writing-mode property