\nDisplay\nDisplay helpers control content visibility and display type based on the viewport.
\n\n\n\n\nClass | \nProperties | \n
\n\n\n\nd-none | \ndisplay: none; | \n
\n\nd-sm-none | \ndisplay: none; | \n
\n\nd-md-none | \ndisplay: none; | \n
\n\nd-lg-none | \ndisplay: none; | \n
\n\nd-xl-none | \ndisplay: none; | \n
\n\nd-xxl-none | \ndisplay: none; | \n
\n\nd-sm-flex | \ndisplay: flex; | \n
\n\nd-md-flex | \ndisplay: flex; | \n
\n\nd-lg-flex | \ndisplay: flex; | \n
\n\nd-xl-flex | \ndisplay: flex; | \n
\n\nd-xxl-flex | \ndisplay: flex; | \n
\n\nd-sm-inline | \ndisplay: inline; | \n
\n\nd-md-inline | \ndisplay: inline; | \n
\n\nd-lg-inline | \ndisplay: inline; | \n
\n\nd-xl-inline | \ndisplay: inline; | \n
\n\nd-xxl-inline | \ndisplay: inline; | \n
\n\nd-sm-inline-block | \ndisplay: inline-block; | \n
\n\nd-md-inline-block | \ndisplay: inline-block; | \n
\n\nd-lg-inline-block | \ndisplay: inline-block; | \n
\n\nd-xl-inline-block | \ndisplay: inline-block; | \n
\n\nd-xxl-inline-block | \ndisplay: inline-block; | \n
\n\nd-sm-table | \ndisplay: table; | \n
\n\nd-md-table | \ndisplay: table; | \n
\n\nd-lg-table | \ndisplay: table; | \n
\n\nd-xl-table | \ndisplay: table; | \n
\n\nd-xxl-table | \ndisplay: table; | \n
\n\nd-sm-table-cell | \ndisplay: table-cell; | \n
\n\nd-md-table-cell | \ndisplay: table-cell; | \n
\n\nd-lg-table-cell | \ndisplay: table-cell; | \n
\n\nd-xl-table-cell | \ndisplay: table-cell; | \n
\n\nd-xxl-table-cell | \ndisplay: table-cell; | \n
\n\nd-sm-table-row | \ndisplay: table-row; | \n
\n\nd-md-table-row | \ndisplay: table-row; | \n
\n\nd-lg-table-row | \ndisplay: table-row; | \n
\n\nd-xl-table-row | \ndisplay: table-row; | \n
\n\nd-xxl-table-row | \ndisplay: table-row; | \n
\n\nd-sm-flex | \ndisplay: flex; | \n
\n\nd-md-flex | \ndisplay: flex; | \n
\n\nd-lg-flex | \ndisplay: flex; | \n
\n\nd-xl-flex | \ndisplay: flex; | \n
\n\nd-xxl-flex | \ndisplay: flex; | \n
\n\nd-sm-inline-flex | \ndisplay: inline-flex; | \n
\n\nd-md-inline-flex | \ndisplay: inline-flex; | \n
\n\nd-lg-inline-flex | \ndisplay: inline-flex; | \n
\n\nd-xl-inline-flex | \ndisplay: inline-flex; | \n
\n\nd-xxl-inline-flex | \ndisplay: inline-flex; | \n
\n\nd-print-none | \ndisplay: none; | \n
\n\nd-print-inline | \ndisplay: inline; | \n
\n\nd-print-inline-block | \ndisplay: inline-block; | \n
\n\nd-print-block | \ndisplay: block; | \n
\n\nd-print-table | \ndisplay: table; | \n
\n\nd-print-table-cell | \ndisplay: table-cell; | \n
\n\nd-print-table-row | \ndisplay: table-row; | \n
\n\nd-print-flex | \ndisplay: flex; | \n
\n\nd-print-inline-flex | \ndisplay: inline-flex; | \n
\n\nd-sr-only | \ndisplay: none; | \n
\n\nd-sr-only-focusable | \ndisplay: none; | \n
\n\n\n\n\n\nUsage\nSpecify the element’s display property. These classes can be applied to all breakpoints from xs to xxl. When using a base class,.d-{value}, it is inferred to be .d-xs-{value}.
\n\n- .d-{value} for xs
\n- .d-{breakpoint}-{value} for sm, md, lg, xl, and xxl
\n
\nThe value property is one of:
\n\n- none
\n- inline
\n- inline-block
\n- block
\n- table
\n- table-cell
\n- table-row
\n- flex
\n- inline-flex
\n
\nWhen setting a specific breakpoint for a display helper class, it will apply to all screen widths from the designation and up. For example, d-lg-flex will apply to lg, xl and xxl size screens.
\n\n\n\n\nVisibility\nConditionally display an element based upon the current viewport. Breakpoint utility classes always apply from the bottom up. That means if you have .d-none, it will apply to all breakpoints. However, .d-md-none will apply to only md and up.
\n\n\n\nScreen size | \nClass | \n
\n\n\n\nHidden on all | \n.d-none | \n
\n\nHidden only on xs | \n.d-none .d-sm-flex | \n
\n\nHidden only on sm | \n.d-sm-none .d-md-flex | \n
\n\nHidden only on md | \n.d-md-none .d-lg-flex | \n
\n\nHidden only on lg | \n.d-lg-none .d-xl-flex | \n
\n\nHidden only on xl | \n.d-xl-none .d-xxl-flex | \n
\n\nHidden only on xxl | \n.d-xxl-none | \n
\n\nVisible on all | \n.d-flex | \n
\n\nVisible only on xs | \n.d-flex .d-sm-none | \n
\n\nVisible only on sm | \n.d-none .d-sm-flex .d-md-none | \n
\n\nVisible only on md | \n.d-none .d-md-flex .d-lg-none | \n
\n\nVisible only on lg | \n.d-none .d-lg-flex .d-xl-none | \n
\n\nVisible only on xl | \n.d-none .d-xl-flex .d-xxl-none | \n
\n\nVisible only on xxl | \n.d-none .d-xxl-flex | \n
\n\n\n\nAlternatively you can hide an element based upon the current viewport using lateral display helper classes. These classes can be applied using the following format hidden-{breakpoint}-{condition?}
\nThe condition applies the class base on:
\n\n- nothing - hide the element only on the specified breakpoint
\n- and-down - hide the element on the specified breakpoint and down - sm through xl only
\n- and-up - hide the element on the specified breakpoint and up - sm through xl only
\n
\nhidden-{breakpoint}-and-up is equivalent to d-{breakpoint}-none.
\nMedia types can also be targeted using the only condition. Both hidden-screen-only and hidden-print-only are currently supported.
\n\nCaveats\n\nIt is important to note that using any of the display classes above will result in any display style previously added being overwritten. This is because of the classes using !important in their display styling.
\n\n\n\n\nDisplay in print\nYou can also change the display property when printing. Print utility classes can also be combined with none print display utilities.
\n\n\n\nAccessibility\n\nScreen readers\nUse the d-sr utility classes to conditionally hide content on all devices except screen readers.
\n\n- d-sr-only visually hides elements but will still announce to screen readers.
\n- d-sr-only-focusable visually hides an element until it is focused. This is useful when implementing skip links.
\n
\n\n\n