tags:

views:

137

answers:

4

Hello,

I have a print page here:

http://www.souq4cars.com/ppreview.php?id=611111161&u=10064&t=users%5Fcars

How do i hide the links at the bottom saying 'Close Window' and 'Print Page' from being printed on the printed page?

+1  A: 
@media print
{
  div.for_hide {
    display: none;
  }
}

or you can include some css with this by including

<link rel="stylesheet" type="text/css" media="print" href="/css/print_version.css">

in your html code.

silent
+1  A: 

You have to make a new style sheet which uses different css.

<link href="style-print.css" rel="stylesheet" media="print"  type="text/css">

Name divs, where you have text, that you don't want to print:

<div style="float: right;" id="print">
    <a href="#" onclick="javascript:window.print(); return false;" class="orange_text"><strong>Print Page</strong></a>

   </div>

In style-print.css set this divs to hidden.

#print {
    display: none; 
}
Trick
+4  A: 

You could use the CSS @media rule for this. To start, add a class noprint to the both elements:

<a class="noprint">foo</a>

and then add a @media print rule to your CSS which hides the elements during print:

@media print {
    .noprint {
        display: none;
    }
}
BalusC
A: 

You should use a print stylesheet and hide the relevant elements there by setting display: none.

You can include a print sheet by adding the following between the head tags: <link rel="stylesheet" href="print.css" type="text/css" media="print" /> Normally you would set the media attribute to screen or something similar.

mensch