0

I have 2 div(div1,div2) and 2 button(full, half) in a HTML file.

when I click button full then It displays both div's contents and print 2 page including div1 and div2 contents.

when I click button half then it dispalys only div2 contents and hide div1. whenever I print the displayed div2, it works on chrome,ff.

display is perfect in all web browser.

my problem is that It prints both page in IE8/9/10 instead of single page. I used below code in css file but @media print does not work.

.div1{
display: none;  
padding-top: 10px;
  }
  @media print {.div1{ display: none; } }

I need to print only displayed page(div2) . please help.

Prak
  • 815
  • 7
  • 18
  • 1
    Which version of IE ? media queries are problematic in IE8 and below . . . – Pat Dobson Oct 08 '13 at 10:43
  • CSS Media Queries [do not work](http://caniuse.com/#search=media%20queries) in IE8, you'll need to use JavaScript to achieve the desired effect in old browsers. Refer to the most upvoted answer (not the accepted one) on this question: http://stackoverflow.com/questions/5769493/ie8-support-for-css-media-query – James Donnelly Oct 08 '13 at 10:47
  • This has nothing to do with media queries. `@media print` is reasonably supported in IE8 and older so something else must be wrong. That being said, are you sure that's the right code? You have `display: none` both in and out of your `@media print` rule. – BoltClock Oct 08 '13 at 10:49
  • Pat, this is in IE8/9/10. – Prak Oct 08 '13 at 14:09
  • BoltClock, It is sure, the code is correct and its tested. – Prak Oct 08 '13 at 14:10

0 Answers0