Jump to content

Hiding Things for Printing


Viper114

Recommended Posts

I'd like to know if PHP has some sort of "hide" method to use so that certain sections that don't need to be seen when you print a page can be hidden while printing.For example, on a section of our website, there is a menu on the right hand side that we have no need to see on the page when it's printed, so I was wondering if there's a PHP method of hiding these for printing, if such a thing exists.

Link to comment
Share on other sites

...and in the print.css, hide the elements you want hidden like (for example):

#menu {	display:none;}

You can also embed the printing stylesheet in your normal stylesheet by adding this into your main CSS file:

@media print {	#menu {		display:none;	}}

Link to comment
Share on other sites

That worked. I just made a new page with the necessary information needed for printing and made it printer friendly. So that's taken care of. Thanks!
You wouldn't even have to make a new page, just include those styles on the existing page. The media rules tell the browser how it should look when viewed in the browser and when it's printed.
Link to comment
Share on other sites

That worked. I just made a new page with the necessary information needed for printing and made it printer friendly. So that's taken care of. Thanks!
ShadowMage is right, the whole point of the "print" media query is so that you don't have to create a new page.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...