Display property

Quickly and responsively toggle the display value of components and more with our display utilities. Includes support for some of the more common values, as well as some extras for controlling display when printing.

Common display values

The display property accepts a handful of values and we support many of them with utility classes. We purposefully don’t provide every value as a utility, so here’s what we support:

  • .d-none_sth
  • .d-inline_sth
  • .d-inline-block_sth
  • .d-block_sth
  • .d-table_sth
  • .d-table-cell_sth
  • .d-flex_sth
  • .d-inline-flex_sth

Put them to use by applying any of the classes to an element of your choice. For example, here’s how you could use the inline, block, or inline-block utilities (the same applies to the other classes).

d-inline_sth
d-inline_sth
<div class="d-inline_sth bg-success_sth">d-inline_sth</div>
<div class="d-inline_sth bg-success_sth">d-inline_sth</div>
d-block_sth
<span class="d-block_sth bg-primary_sth">d-block_sth</span>
d-inline-block_sth
d-inline-block_sth
<div class="d-inline-block_sth bg-warning_sth">d-inline-block_sth</div>
<div class="d-inline-block_sth bg-warning_sth">d-inline-block_sth</div>

Responsive variations also exist for every single utility mentioned above.

  • .d-none_sth
  • .d-inline_sth
  • .d-inline-block_sth
  • .d-block_sth
  • .d-table_sth
  • .d-table-cell_sth
  • .d-flex_sth
  • .d-inline-flex_sth
  • .d-sm-none_sth
  • .d-sm-inline_sth
  • .d-sm-inline-block_sth
  • .d-sm-block_sth
  • .d-sm-table_sth
  • .d-sm-table-cell_sth
  • .d-sm-flex_sth
  • .d-sm-inline-flex_sth
  • .d-md-none_sth
  • .d-md-inline_sth
  • .d-md-inline-block_sth
  • .d-md-block_sth
  • .d-md-table_sth
  • .d-md-table-cell_sth
  • .d-md-flex_sth
  • .d-md-inline-flex_sth
  • .d-lg-none_sth
  • .d-lg-inline_sth
  • .d-lg-inline-block_sth
  • .d-lg-block_sth
  • .d-lg-table_sth
  • .d-lg-table-cell_sth
  • .d-lg-flex_sth
  • .d-lg-inline-flex_sth
  • .d-xl-none_sth
  • .d-xl-inline_sth
  • .d-xl-inline-block_sth
  • .d-xl-block_sth
  • .d-xl-table_sth
  • .d-xl-table-cell_sth
  • .d-xl-flex_sth
  • .d-xl-inline-flex_sth

Hiding Elements

For faster mobile-friendly development, use responsive display classes for showing and hiding elements by device. Avoid creating entirely different versions of the same site, instead hide element responsively for each screen size.

To hide elements simply use the .d-none_sth class or one of the .d-{sm,md,lg,xl}-none_sth classes for any responsive screen variation.

To show an element only on a given interval of screen sizes you can combine one .d-*-none_sth class with a .d-*-*_sth class, for example .d-none_sth.d-md-block_sth.d-xl-none_sth will hide the element for all screen sizes except on medium and large devices.

Screen Size Class
Hidden on all d-none_sth
Hidden only on xs d-none_sth d-sm-block_sth
Hidden only on sm d-sm-none_sth d-md-block_sth
Hidden only on md d-md-none_sth d-lg-block_sth
Hidden only on lg d-lg-none_sth d-xl-block_sth
Hidden only on xl d-xl-none_sth
Visible on all d-block_sth
Visible only on xs d-block_sth d-sm-none_sth
Visible only on sm d-none_sth d-sm-block_sth d-md-none_sth
Visible only on md d-none_sth d-md-block_sth d-lg-none_sth
Visible only on lg d-none_sth d-lg-block_sth d-xl-none_sth
Visible only on xl d-none_sth d-xl-block_sth

Display in print

Change the display value of elements when printing with our print display utilities.

Class Print style
.d-print-block_sth Applies display: block to the element when printing
.d-print-inline_sth Applies display: inline to the element when printing
.d-print-inline-block_sth Applies display: inline-block to the element when printing
.d-print-none_sth Applies display: none to the element when printing