Border Opacity

Utilities for controlling the opacity of an element’s border color.

Use the border opacity utilities to change the opacity of an element’s border color.

Quick reference

ClassProperties
.border-opacity-10border-opacity: 0.1;
.border-opacity-25border-opacity: 0.25;
.border-opacity-50border-opacity: 0.5;
.border-opacity-75border-opacity: 0.75;
.border-opacity-100border-opacity: 1;

Basic examples

Changing the opacity

Use the border-opacity-75, border-opacity-50, or border-opacity-25 to change the opacity of an element’s border color.

  <div class="border border-4 border-secondary border-opacity-100 ..."></div>
  <div class="border border-4 border-secondary border-opacity-75 ..."></div>
  <div class="border border-4 border-secondary border-opacity-50 ..."></div>

Customize the opacity

To change that opacity, override --bs-border-opacity via custom styles or inline styles.

  <div class="border border-4 border-secondary ..." style="--bs-border-opacity: 1"></div>
  <div class="border border-4 border-secondary ..." style="--bs-border-opacity: 0.65"></div>
  <div class="border border-4 border-secondary ..." style="--bs-border-opacity: 0.45"></div>