Jump to content

Hiding Things for Printing


Viper114
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...