Display property
Quickly 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.
How it works
Change the value of the display property with our display utility classes. We purposely support only a subset of all possible values for display. Classes can be combined for various effects as you need.
Notation
The classes are named using the format:.d-{value}
Where value is one of:
noneinlineinline-blockblockgridinline-gridtabletable-celltable-rowflexinline-flex
The display values can be altered by changing the display values defined in $utilities and recompiling the SCSS.
Hiding elements
Use display classes for showing and hiding elements.To hide elements simply use the .d-none class.
| Screen size | Class |
|---|---|
| Hidden on all | .d-none |
| Visible on all | .d-block |
Display in print
Change the display value of elements when printing with our print display utility classes. Includes support for the same display values as our .d-* utilities.
.d-print-none.d-print-inline.d-print-inline-block.d-print-block.d-print-grid.d-print-inline-grid.d-print-table.d-print-table-row.d-print-table-cell.d-print-flex.d-print-inline-flex
The print and display classes can be combined.
<div class="d-print-none">Screen Only (Hide on print only)</div>
<div class="d-none d-print-block">Print Only (Hide on screen only)</div>
<!--<div class="d-none d-lg-block d-print-block">Hide up to large on screen, but always show on print</div>-->CSS
Sass utilities API
Display utilities are declared in our utilities API in scss/_utilities.scss. Learn how to use the utilities API.
"display": (
responsive: true,
print: true,
property: display,
class: d,
values: inline inline-block block grid inline-grid table table-row table-cell flex inline-flex none
),