I am very new to CSS and I am trying to add a footer at the end of my html page. I want it to be hidden when the page is displayed, but want it show up when the page is printed.
I tried something like the following, which I don't think is right.
out.write("
Any suggestions? Thanks.
<div id="footer">©
#footer { display: none; } /* in style.css */
#footer { display: block; } /* in print.css */
That's how I would handle it.
Another option, you put your
Another option, you put your html out, with #footer
inside the one css file:
@media print {
#footer { display: block; }
}
@media screen {
#footer { display: none; }
}
using @media is a cheaper way to do things if your only hiding/showing a few elements between the two styles.
Thank you for your help.
Thank you for your help. They both work work perfectly.