Crashing IE6
While testing sites I rarely get the opportunity to test printing on all browsers/platforms. Well the other day a client comes back to me and claims that their site has been crashing and always has when trying to print.
Here is the problem:
* site crashes when attempting to print in internet explorer 6
* site is template based, all pages but first share the same template
* only some pages crash while printing
I start testing why this is happening and get no where. I call in backup. A quick IM to Joe D’Andrea and he was on the case. Within an hour he has a quick fix. Thinking there is something bigger going on he calls in Vincent Murphy to assist.
Go crash your browser here.
What we discovered has something to do with page breaks and how IE is dealing with them. I reduced the css and page a bit, then Joe and Vincent took it further. The minimal CSS they came up with is:
div#a { position: absolute; margin: 0; }
div#b { margin-top: -1px; }
If we remove any individual style and it will print. The issue rests in the -1 and its interaction with the margin or position (breaking its bounds). This -1 (originally -10) was a fix placed in there to correct screen display in IE in the first place.
HTML looks like this:
<body>
<div id="a">
.
<div id="b">
Lorem ipsum dolor...
</div>
</div>
</body>
We can take it one step further and as long as we keep the text in div b to a certain length (much shorter then it is now), it will print. Or we can just go and remove the dot in div a and it will print as well.
While trying to figure this out these are some links we found:
* Dreamweaver TechNote
* IE is teh 3v1l from JamisBuck
* When Printing Kills from Eric Meyer
* IE blog on MSDN
* IE 6.0 crashes when printing… from Milonic