Related Entries

Taming lists
CSS Techniques
Proper use of CSS in layout
Style switcher
IE5.5 and CSS dotted border

« Unixifying Windows
» Good Solution for managing web sites?

CSS IEeeeeee

Can't Microsoft make this standard compliant?

I had added in a printer friendly CSS a week ago. Since I don’t use IE generally, I was under the impression that everything works, since it tested fine under Mozilla and Opera. Today, I viewed my site using IE at work and blast, the side bar is all gone.

Here’s my code:

<style type="text/css" media="print">
@import "print.css";
</style>

And in print.css, I specify my sidebar div’s to be display:none. So, when printing all these are masked. Stupid IE seems to ignore media="print" and takes it as the CSS for screen too.

Readers using IE, sorry for this mishap. Need to research a bit more to see what is the hack for solving this. For the moment, I commented out the style sheet for printer.

Moral

  1. When redesigning, summon enough willpower to boot to Windows and test it using IE.
  2. Make everyone aware of Mozilla.
  1. I think you can probably get it to work if you do it as follows:

    <style type="text/css" >
    @media print {
    @import "print.css";
    }
    </style>

    see http://blooberry.com/indexdot/css/syntax/atrules/media.htm

    Posted by: Sanjay Sheth on September 3, 2002 05:50 PM
  2. It works for me in IE version 6.0.2600.

    I am doing something like this.


    @import url( style/prin.css );

    and in CSS i have something like this

    div#punch { display:none;}

    It should work in IE too as i have done this in Past and it has worked. Else you make the width and Height equals to 0.

    Posted by: pramod on September 4, 2002 12:37 PM
//-->