Skip to content

Border Style

Utilities for controlling the style of an element's borders.

❗ Keep in mind

To establish borders, it's essential to commence class declarations with border.

This action defines a default solid border of 1px rgba(var(--cds-sys-color-stroke), var(--cds-sys-stroke-opacity)) for the element. Subsequently, varying border styles can be implemented by assigning classes as outlined on this page.

Class NameCSS Equivalent
.border-noneborder-style: none;
.border-b-noneborder-block-style: none;
.border-i-noneborder-inline-style: none;
.border-bs-noneborder-block-start-style: none;
.border-be-noneborder-block-end-style: none;
.border-is-noneborder-inline-start-style: none;
.border-ie-noneborder-inline-end-style: none;
.border-hiddenborder-style: hidden;
.border-b-hiddenborder-block-style: hidden;
.border-i-hiddenborder-inline-style: hidden;
.border-bs-hiddenborder-block-start-style: hidden;
.border-be-hiddenborder-block-end-style: hidden;
.border-is-hiddenborder-inline-start-style: hidden;
.border-ie-hiddenborder-inline-end-style: hidden;
.border-dashedborder-style: dashed;
.border-b-dashedborder-block-style: dashed;
.border-i-dashedborder-inline-style: dashed;
.border-bs-dashedborder-block-start-style: dashed;
.border-be-dashedborder-block-end-style: dashed;
.border-is-dashedborder-inline-start-style: dashed;
.border-ie-dashedborder-inline-end-style: dashed;
.border-solidborder-style: solid;
.border-b-solidborder-block-style: solid;
.border-i-solidborder-inline-style: solid;
.border-bs-solidborder-block-start-style: solid;
.border-be-solidborder-block-end-style: solid;
.border-is-solidborder-inline-start-style: solid;
.border-ie-solidborder-inline-end-style: solid;
.border-dottedborder-style: dotted;
.border-b-dottedborder-block-style: dotted;
.border-i-dottedborder-inline-style: dotted;
.border-bs-dottedborder-block-start-style: dotted;
.border-be-dottedborder-block-end-style: dotted;
.border-is-dottedborder-inline-start-style: dotted;
.border-ie-dottedborder-inline-end-style: dotted;
.border-doubleborder-style: double;
.border-b-doubleborder-block-style: double;
.border-i-doubleborder-inline-style: double;
.border-bs-doubleborder-block-start-style: double;
.border-be-doubleborder-block-end-style: double;
.border-is-doubleborder-inline-start-style: double;
.border-ie-doubleborder-inline-end-style: double;
.border-grooveborder-style: groove;
.border-b-grooveborder-block-style: groove;
.border-i-grooveborder-inline-style: groove;
.border-bs-grooveborder-block-start-style: groove;
.border-be-grooveborder-block-end-style: groove;
.border-is-grooveborder-inline-start-style: groove;
.border-ie-grooveborder-inline-end-style: groove;
.border-insetborder-style: inset;
.border-b-insetborder-block-style: inset;
.border-i-insetborder-inline-style: inset;
.border-bs-insetborder-block-start-style: inset;
.border-be-insetborder-block-end-style: inset;
.border-is-insetborder-inline-start-style: inset;
.border-ie-insetborder-inline-end-style: inset;
.border-outsetborder-style: outset;
.border-b-outsetborder-block-style: outset;
.border-i-outsetborder-inline-style: outset;
.border-bs-outsetborder-block-start-style: outset;
.border-be-outsetborder-block-end-style: outset;
.border-is-outsetborder-inline-start-style: outset;
.border-ie-outsetborder-inline-end-style: outset;
.border-ridgeborder-style: ridge;
.border-b-ridgeborder-block-style: ridge;
.border-i-ridgeborder-inline-style: ridge;
.border-bs-ridgeborder-block-start-style: ridge;
.border-be-ridgeborder-block-end-style: ridge;
.border-is-ridgeborder-inline-start-style: ridge;
.border-ie-ridgeborder-inline-end-style: ridge;

Setting the border style on all sides

Use border-{style} to control an element’s border style.

border-solid
border-dashed
border-dotted
border-double
html
<div class="[...] border border-solid">border-solid</div>
<div class="[...] border border-dashed">border-dashed</div>
<div class="[...] border border-dotted">border-dotted</div>
<div class="[...] border border-double">border-double</div>

Setting border style on individual sides

Use the border-{i|b}?{e|s}?-{style} utilities to set the border style on the vertical or horizontal sides (based on the text direction) of an element at the same time.

💡 Tip

In our development practices, we aim to avoid the use of physical properties such as top, bottom, right, and left. Instead, we advocate for the use of logical properties: {block|inline}-{end|start}. To enhance your understanding of these logical properties, we recommend visiting the Foundation/Logical Properties page.

Abbriviation
bblock (default vertical axis)
iinline (default horizontal axis)
sstart (top for block, left for inline)
eend (bottom for block, right for inline)

As an illustration, consider using the class border-bs-dotted to apply a dotted border-style on the top side (inline-end) of the element, based on the text direction.

Similarly, the class border-ie-dashed will add a dashed border-style on the right side (inline-end) of the element, depending on its text direction.

border-i-dashed
border-ie-double
border-is-dotted
border-b-ridge
border-be-inset
border-bs-solid
border-b-dashed,border-is-inset, border-idouble-2
html
<div class="[...] border-i-dashed">border-i-dashed</div>
<div class="[...] border-ie-double">border-ie-double<div>
<div class="[...] border-is-dotted">border-is-dotted</dv>
<div class="[...] border-b-ridge">border-b-ridge</di>
<div class="[...] border-be-inset">border-be-inset<div>
<div class="[...] border-bs-solid">border-bs-solid</dv>
<div class="[...] border-b-dashed border-is-inset borer-ie-double">border-b-dashed,border-is-inset, border-idouble-2</div>