CSS border-block-end egenskap

Course recommendation:

border-block-end Definition and usage

CSS border-block-end attributes are shorthand forms of the following CSS border-bottom,border-left,border-right and border-top The attributes are very similar, but border-block-end 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 and border-block-end The result of the attribute. For English pages, the inline direction is from left to right, and the block direction is downward.

Example

Example 1

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

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

Try it yourself

Example 2: Combined with the writing-mode attribute

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

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

Try it yourself

CSS syntax

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

Attribute value

Value Description
border-block-end-width

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

The default value is "medium".

border-block-end-style

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

The default value is "none".

border-block-end-color

Specifies the border color at the end 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.borderBlockEnd="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

Manual:CSS kant

Referens:CSS border egenskap

Referens:CSS border-block egenskap

Referens:CSS border-block-color egenskap

Referens:CSS border-block-start-color egenskap

Referens:CSS border-bottom-color egenskap

Referens:CSS border-left-color egenskap

Referens:CSS border-right-color egenskap

Referens:CSS border-top-color egenskap

Referens:CSS writing-mode egenskap