Using media = "print" for IE8
<link rel="stylesheet" href="printStyle.css" media="print" /> This line captures print previews for Chrome / IE7 and IE9, but doesn't seem to work with IE8. Has anyone understood any idea?
After some comments, I realized that this is an IE8 problem. I was about to unite and came up with the following at the top of my section:
<!--[if lt IE 9]> <script src="http://html5shiv-printshiv.googlecode.com/svn/trunk/html5shiv-printshiv.js"></script> <![endif]--> This allows you to use a common stylesheet with @media print {} .
This again works in IE7 / 9, not IE8. I can not, again, understand why. But printshiv really works, otherwise I could not get the correct preview in IE7.
I finally figured out what went wrong (with great luck ..)
For some reason, the following css did not do this job:
#divID1, #divID2, #divID3 { display: none; } Modified by:
#divID1 { display: none; } #divID2 { display: none; } #divID3 { display: none; } and now it works in IE8. I canβt understand why ..
This is not supported in IE8. Possible workarounds are offered in IE8 support for CSS Media Query . Hope this helps. :-)