Web Global Net Web Application & Web Development Project Center

Technical Issues => CSS Related => Topic started by: admin on August 29, 2019, 07:15: PM



Title: Hiding or showing an element or section of a page when printing - Bootstrap 4
Post by: admin on August 29, 2019, 07:15: PM
use this as the class for a DIV wrap of the section or element you do not what to show when printing.

<div align="center" class="d-print-none">  Content or Element </div>

class="d-print-none" is built into Bootstrap 4 so no need to add it to your print.css file if you have one  class="d-print-none" will stop something from printing.

Example:This will stop a button from showing when printing.

<div class="d-print-none"><div style="text-align: center; "><a href="new_listing.php?ag=<?php echo $_GET['ag']; ?>"  class="SBAbuttongreen3 noprint">Click here[/url]</div></div>


To hide on screen and show on print

<div class="d-none d-print-block"> </div>




<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>