Accessibility

CSS Advisor

Elements do not display correctly in Internet Explorer 5 when a print stylesheet is applied

by Thierry Koblentz on December 18, 2006
Edited by: sfegette on December 1, 2009
Avg Rating 3.7 (3)   |   Log in to rate post.

Tagged with broken layout , Display , Explorer 5.0 , Position , invisible , Text , missing , Explorer 5.5 , Width/Height , Explorer for Mac

Problem

Internet Explorer 5 renders elements incorrectly, and appears to apply your 'print' stylesheet instead of the correct 'screen' stylesheet for browser-based rendering.

Solution

Use the link element to include your print stylesheet in IE 5.x, as opposed to the @import rule.

Detailed description

Internet Explorer v. 5 will apply the rules in the print stylesheet to your onscreen (screen stylesheet) rules, which causes page elements to not show on screen and other oddities.

The solution is to use the "link" element rather than the @import rule. So you'd use this:

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


Rather than this:

<style type="text/css" media="print">
<!--
@import "stylesheet.css";
-->
</style>
You can view a test page here:
Test case







Text ID:



Comments (1)

To add a comment, please Log in.




Minor updates/edits added...

- Updated title to be more specific to problem
- Minor edits to body copy

Thanks, Thierry!





CSS Advisor home
Submit a post

rss

CSS ADVISOR RSS FEEDS
Recent: POSTS | COMMENTS | EDITS


Browsers
Internet Explorer (45)
Mozilla/Firefox (16)
Opera (7)
Safari (13)
CSS Properties
Background (6)
Border (3)
Color (1)
Float (15)
Font (1)
Margin (6)
Padding (4)
Position (15)
Text (13)
Width/Height (9)