GregD
GregD

Reputation: 1944

Using media="print" for IE8

<link rel="stylesheet" href="printStyle.css" media="print" />

This line fixes the print preview for Chrome / IE7 and IE9 but it doesn't seem to work with IE8.. Has anyone got any idea?

After some comments I realized it's a IE8 problem. I've been goolgeing around and came up with adding the following on the top of my section:

<!--[if lt IE 9]>
    <script src="http://html5shiv-printshiv.googlecode.com/svn/trunk/html5shiv-printshiv.js"></script>
<![endif]-->

This makes it possible to use a general stylesheet with @media print {}.

This, again, works in IE7 / 9 and not in IE8.. Can't, again, really figure out why. But the printshiv does work otherwise I wouldn't be able to get the correct print preview in IE7.

Upvotes: 8

Views: 6581

Answers (2)

GregD
GregD

Reputation: 1944

I finally figured out what went wrong (with a lot of luck..)

For some reason the following css didn't do the job:

#divID1, #divID2, #divID3 { display: none; }

Changed it to:

#divID1 {
   display: none;
}

#divID2 {
   display: none;
}

#divID3 {
   display: none;
}

and now it works in IE8. Can't really figure out why..

Upvotes: 6

CCarter
CCarter

Reputation: 1

This is not supported in IE8. Possible workarounds are suggested at IE8 support for CSS Media Query. Hope this helps. :-)

Upvotes: -4

Related Questions