Hide Header and Footer in IE while Printing page

Hide Header and Footer in IE while Printing page

  
Hello Team,

I need to hide header and footer on print page. 
I managed to hide it in chrome using css: @page rule
"
 @page 
        {
           
            size: auto;   /* auto is the current printer page size */
            margin: 0mm;  /* this affects the margin in the printer settings */
        }
"
But same code in IE 9 isnt working properly. 
For instance: if I give margin as 0mm or -2 mm, the page goes behind the header that means top part of the page is being chopped off.

Any code written in @page rule will respond in IE but header and footer is not hiding, the top part of the page is getting chopped off.

I am printing the page using javascript: window.print().

Could you please suggest on this.

Thanks,
Shweta
@media print {
  .Footer { display:none; }
}
J. wrote:
@media print {
  .Footer { display:none; }
}
 
 Hi J,
I tried using in expression placed in web screen.
 <style>
    @media print 
    {
    .Footer {display: none;}
        
    }  



</style>
in IE 9 , footer is still displaying.
And also I tried writing css code in a css file and referencing it in a web screeen.
No success.
Is it working for you in IE 9?
Regards,
Shweta
Team,

Is it possible to hide header and footer in IE 9 while printing page.

Regards,
Shweta
Make sure IE9 is not in compability mode.

Basically inline CSS3 media queries DO work in IE9 but you have to disable Compatibilty mode

<meta http-equiv="X-UA-Compatible" content="IE=9">
Hi J,

Thank you for the response.
Below are my points:

1: Compatibility mode is disabled.
2: I added <meta http-equiv="X-UA-Compatible" content="IE=9"> in a head tag  and style " @media print
    {
    .Footer {display: none;}
        
    }  
 
" to hide footer in style tag in expresseion widget placed in a web screen.
3: It did not hide the footer in print page, because the header and footer is added by the browser not my application.So i cannot assign .footer class in my application to hide footer.


Regards,
Shweta
pardon?
the header and footer is added by the browser?
if that is the case, you cannot do anything about it, since it's controlled by the "print-dialog"


Hi J,

I am not designing header and footer in my application, So cannot hide it.
As per My first post , I managed to hide header and footer using css: @page rule
"
 @page 
        {
           
            size: auto;   /* auto is the current printer page size */
            margin: 0mm;  /* this affects the margin in the printer settings */
        }
".
This way header and footer will be moved out of the page , as i am setting page's margin as 0mm.(This works fine in chrome)
But in IE , header is overlapping the page, meaning top part of the page is chopped off.

In chrome its fine.

Thanks,
Shweta