View Full Version : Making a Div show when Print style sheet is in use
lowmarklow
06-18-2010, 10:45 AM
Hi Guys,
As the title suggests, I am wondering if there IS a way of showing a Div (That is of course hidden) when the Print style sheet is in use (Print preview basically).
I've tried so many ways and I can't find out how to do it.
Thanks,
Mark
zip222
06-18-2010, 12:54 PM
Assuming that you already have the two style sheets in place, one for the screen display and another for print, tt's actually quite simple....
In the screen style sheet you need to hide the div in question:
DIV_ID_OR_CLASS { display: none; }
And in the print style sheet, don't hide it:
DIV_ID_OR_CLASS { }
I frequently utilize a .printonly class, which I apply to anything that I only want to display when the site is printed. I hide this class in my screen style sheet, but don't hide it in the print style sheet. I include this as part of my base framework for all sites that I build.
If you need more clarification than this just let me know.
lowmarklow
06-18-2010, 02:18 PM
You, my friend, are a legend!
It actually works when you add 'media="screen" ' to the style sheet link that features the Div's functions.
Thanks again!
Mark
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.