# HTML (ASP): Can I suppress text except for printing?

**URL:** <https://boards.straightdope.com/t/html-asp-can-i-suppress-text-except-for-printing/600658>\
**Category:** Factual Questions\
**Created:** [October 24, 2011, 6:20pm UTC](https://boards.straightdope.com/t/html-asp-can-i-suppress-text-except-for-printing/600658 "2011-10-24T18:20:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tdn](https://avatars.discourse-cdn.com/v4/letter/t/94ad74/32.png) [@tdn](https://boards.straightdope.com/u/tdn)\
**Post date:** [October 24, 2011, 6:20pm UTC](https://boards.straightdope.com/t/html-asp-can-i-suppress-text-except-for-printing/600658/1 "2011-10-24T18:20:40Z")

</div>

I just got a strange request at work. My boss wants three fields on an online form, for signature, date, and time. These are going to be filled in with a pen on the printout. But I don’t want them to show up on people’s monitors.

Is there any way to do that? FWIW, the page has a background image, and some printers are black and white and others a color.

---

<div class="post-metadata">

**Author:** ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)\
**Post date:** [October 24, 2011, 6:26pm UTC](https://boards.straightdope.com/t/html-asp-can-i-suppress-text-except-for-printing/600658/2 "2011-10-24T18:26:18Z")

</div>

Make them invisible, and then create a separate stylesheet for printing (media=“print”) in which they are visible.

This relies on the browser supporting stylesheets for print, of course, but I’m pretty sure all reasonable configurations do.

---

<div class="post-metadata">

**Author:** ![Turek](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/turek/32/18782_2.png) [@Turek](https://boards.straightdope.com/u/Turek)\
**Post date:** [October 24, 2011, 6:27pm UTC](https://boards.straightdope.com/t/html-asp-can-i-suppress-text-except-for-printing/600658/3 "2011-10-24T18:27:26Z")

</div>

I’m not an HTML guy, but you should be able to do it with a print style sheet. It involves setting the media of your style.

Here’s a good resource with an answer:

> <https://stackoverflow.com/questions/3463796/how-to-only-show-certain-parts-with-css-for-print>

---

<div class="post-metadata">

**Author:** ![tdn](https://avatars.discourse-cdn.com/v4/letter/t/94ad74/32.png) [@tdn](https://boards.straightdope.com/u/tdn)\
**Post date:** [October 24, 2011, 7:09pm UTC](https://boards.straightdope.com/t/html-asp-can-i-suppress-text-except-for-printing/600658/4 "2011-10-24T19:09:03Z")

</div>

I’ll try that out, thanks!

---

<div class="post-metadata">

**Author:** ![Gary\_Robson](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/gary_robson/32/3448_2.png) [@Gary\_Robson](https://boards.straightdope.com/u/Gary_Robson)\
**Post date:** [October 26, 2011, 12:01am UTC](https://boards.straightdope.com/t/html-asp-can-i-suppress-text-except-for-printing/600658/5 "2011-10-26T00:01:25Z")

</div>

Looks like you have some solid answers already.

Yes, everything centers on using {display:none;} for the main style sheet to hide the elements, and then a standard display style definition on the print style sheet. I use the reverse of that for elements that shouldn’t show up on the printed version (e.g., navigation elements).
