Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<STYLE MEDIA="print" TYPE="text/css">

Status
Not open for further replies.

Mighty

Programmer
Feb 22, 2001
1,682
US
Guys,

I have two DIVs on my page - one contains the screen view and one is the print version. When the user wants to print the page, i want to hide the screen view and print the printView DIV. I have inserted the following in the HEAD section of my page:

<STYLE MEDIA=&quot;print&quot; TYPE=&quot;text/css&quot;>
/* hide the Screen view of the statement */
#screenView {display: none;}
/* display the print version of the statement */
#printView {display: block;}
</STYLE>

However, when I print, it still prints the screenView DIV. Any ideas?? Mise Le Meas,

Mighty :)
 
Managed to get this working using the following:

<STYLE>

@media print {
#screenView {display: none;}
#printView {display: block;}
}

@media screen {
#screenView {display: block;}
#printView {display: none;}
}
</STYLE> Mise Le Meas,

Mighty :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top