Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide a div in a page and make it visible only on print bootstrap 3 MVC 5

There is a web page showing information to the user. If the user decides to print it I want to include additional information that is not required on the screen, but would be helpful when printed.

In order to implement this behaviour I was trying to make a div visible only for printing. It hasn't worked though:

<div class="visible-print hidden-lg hidden-md hidden-sm hidden-xs">

I'm using Bootstrap 3 and wondered if there is an easy way to accomplish this?

like image 210
Ben Junior Avatar asked Apr 16 '14 00:04

Ben Junior


1 Answers

I think the fact you've used

hidden-lg hidden-md hidden-sm hidden-xs

across the div means you've effectively hidden it across all viewports. To simply hide or show a div for print use the following:

<div class="hidden-print">content for non print</div>

<div class="visible-print">content for print only</div>
like image 173
SkyBlues87 Avatar answered Sep 19 '22 13:09

SkyBlues87