How can I add print-specific styles with d-print-* utilities?
Asked on Sep 09, 2025
1 Answer
Bootstrap provides `d-print-*` utilities to control the display of elements when printing. These utilities allow you to show or hide elements specifically for print media.
<!-- BEGIN COPY / PASTE -->
<div class="d-none d-print-block">
This text will only be visible when printing.
</div>
<div class="d-print-none">
This text will be hidden when printing.
</div>
<!-- END COPY / PASTE -->
Additional Comment:
✅ Answered with Bootstrap 5 best practices.- Use `d-none d-print-block` to hide an element on screen but show it when printing.
- Use `d-print-none` to hide an element when printing.
- These utilities help customize the print layout without affecting the screen display.