Andrew Thompson's Occasional Commentary
Just Another GetSimple Website
Just Another GetSimple Website
Non Printing Sections with CSS
To Print, Or Not To Print
While working on a page, you may decide that it would look better if a certain image or text didn't appear when printed. CSS allows you to specify that an element doesn't display when the document is rendered. Here, we use this to our advantage, by creating an alternate stylesheet for printed media.
How to Do It
<style type=""text/css"" media=""print"">
<!--
.noprint { display: none}
-->
</style>
<style type=""text/css"" media=""screen"">
<!--
.noprint { display: visible}
-->
</style>
With this stylesheet in place, you can give any portion of your document the id of "noprint" and make that section just vanish!
Happy Non-Printing!