CSS border-block-end-style

The border-block-end-style property in CSS specifies the line style of the block-end border of an element. The block-end side depends on the writing mode, directionality, and text orientation. This property allows you to define various border styles like solid, dotted, dashed, and more.


Syntax of border-block-end-style

</>
Copy
border-block-end-style: none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset | initial | inherit;

Values

ValueDescription
noneNo border is drawn.
hiddenSame as none, but ensures no border conflict in table elements.
dottedA dotted border.
dashedA dashed border.
solidA single solid line border.
doubleTwo lines make up the border. The space between the lines is defined by the border width.
grooveA carved border effect.
ridgeA raised border effect.
insetAn embedded border effect.
outsetA border that looks like it is coming out of the page.
initialSets the property to its default value (none).
inheritInherits the value from the parent element.

Default Value

none


Examples for border-block-end-style

Using the CSS border-block-end-style Property

The following examples demonstrate how to use the border-block-end-style property with different values.

</>
Copy
/* Apply a solid border style to the block-end */
.element {
  border-block-end-style: solid;
}

/* Apply a dashed border style to the block-end */
.element {
  border-block-end-style: dashed;
}

/* Apply no border to the block-end */
.element {
  border-block-end-style: none;
}

/* Inherit the block-end border style from the parent */
.element {
  border-block-end-style: inherit;
}

Example for a Dashed Block-End Border

Below is an example demonstrating how to use border-block-end-style: dashed; to apply a dashed border to the block-end side:

index.html

</>
Copy
<!DOCTYPE html>
<html lang="en">
<head>
<style>
  .box {
    width: 300px;
    border-block-end: 4px;
    border-block-end-style: dashed;
    border-block-end-color: red;
  }
</style>
</head>
<body>

<h2 class="box">Lorem Ipsum</h2

</body>
</html>

Example for a Dotted Block-End Border

border-block-end-style: dotted;

</>
Copy
<!DOCTYPE html>
<html lang="en">
<head>
<style>
  .box {
    width: 300px;
    border-block-end: 4px;
    border-block-end-style: dotted;
    border-block-end-color: red;
  }
</style>
</head>
<body>

<h2 class="box">Lorem Ipsum</h2>

</body>
</html>

Example for a Solid Block-End Border

border-block-end-style: solid;

</>
Copy
<!DOCTYPE html>
<html lang="en">
<head>
<style>
  .box {
    width: 300px;
    border-block-end: 4px;
    border-block-end-style: solid;
    border-block-end-color: red;
  }
</style>
</head>
<body>

<h2 class="box">Lorem Ipsum</h2>

</body>
</html>

Browser Support

The border-block-end-style property is supported in modern browsers. Below is a compatibility table:

BrowserVersion
Chrome69.0
Edge79.0
Firefox41.0
Safari12.1
Opera56.0