Printer Friendly on-the-fly??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Printer Friendly on-the-fly??

Post by simonmlewis »

Oh now there is an idea that I hadn't thought of.
Can you do the same with DIVs too?
So if you have classes assigned to DIVs for display and layout, you could surround an entire DIV section with another and class that up. And disabled on the CSS.

How would u disabled an entire div from even showing, via CSS?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
s992
Forum Contributor
Posts: 124
Joined: Wed Oct 27, 2010 3:06 pm

Re: Printer Friendly on-the-fly??

Post by s992 »

The same way you would do it with images. My recommendation would be to create your entire print stylesheet WITHOUT the @media print query attached to it so that you can preview it in your browser as you make modifications. After you're done, wrap it all in @media print and see how it looks when you print it.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Printer Friendly on-the-fly??

Post by VladSun »

simonmlewis wrote:Oh now there is an idea that I hadn't thought of.
Can you do the same with DIVs too?
So if you have classes assigned to DIVs for display and layout, you could surround an entire DIV section with another and class that up. And disabled on the CSS.

How would u disabled an entire div from even showing, via CSS?
Of course you can do it :) You can do a lot more... just read the CSS manual
There are 10 types of people in this world, those who understand binary and those who don't
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Printer Friendly on-the-fly??

Post by simonmlewis »

s992 has cracked it.
Yes I knew you could, just forgot the simple way to do it.
Have worked it out for screen, will test it tomorrow in print.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Post Reply