Strange IE7 Printing Error

I have a page that displays fine IE6 / 7 and Firefox 3.5. IE6 and Firefox 3.5 have no problem printing the page, but IE7. When the page prints, the first half of my div content is not displayed, except for the two tables that are displayed. Content begins to appear in the middle of a sentence where there is no tag or break of any kind.

This is almost like hiding the first half of a div, but allows tables to be shown. However, I have no off-site tags, no magic empty floating divs or any validation errors, and I have several other pages that use the same CSS as the whole print.

Has anyone ever experienced something like this? How did you fix this (if you did not give up on disappointment)?

Edit: I finally got more time to look at this, and I narrowed down the problem pretty much. I can make the whole text appear by doing one of two things: changing the position attribute of the “position” in the div to something other than “absolute” (which leads to incorrect positioning) or by commenting out a small amount of content.

Here is the content to comment on ...

<p><strong>Personal Expenses: </strong>EJTH will bill your credit card for any additional expenses (extension <!--XXXX-->airfare, etc.), if applicable. <strong><!-- begin broken part --><em>All charges must be paid in full before your electronic ticket confirmation will be emailed. No payments will be accepted on-site. Note:</em></strong> When using a credit card for personal purchases (ie, optional activities, trip extensions, conference registration fees, etc.), &ldquo;MT&rdquo; will appear as the vendor on your credit card statement.</p> <p>You will also be responsible for any personal charges you incur. These include phone calls, valet and laundry service or personal bar bills. The resort cashier will keep a separate record of these expenditures for you. Be sure to settle your personal account at the resort front desk prior to departure. <strong><em>Important: If you neglect to pay your personal (incidental) account when you check out, EJTH will bill you after the program for the actual cost, plus a 15% service charge.</em></strong><!-- end broken part --></p>

Hope this helps you more than it helped me. I'm going to try and work with CSS to work, assuming I am not attracted to anything else today.

Edit: Screens!

The page is printed first. I put XXXX on the page where the content reappears; I also put it in the code above. You can see this if you squint a little.

http://img109.imageshack.us/img109/589/current.jpg

The second is how the page prints if I change the CSS position of the div contents relative to the relative absolute.

http://img514.imageshack.us/img514/9961/modcss.jpg

The third is how the page prints if I comment on the Broken Part. That is, just fine.

http://img514.imageshack.us/img514/653/commented.jpg

+4
source share
3 answers

Not quite the answer, I'm afraid, but that was too much for comment ...

How is "all wrong" position when changing the position attribute? Are you talking about positioning on a printed page or in a browser? If your browser uses a separate print style sheet ...

Can you just “fix” the page by deleting these two paragraphs or deleting the other paragraphs in the same div and, possibly, on the same printed page, which are about the same length, also fix it?

A small Google search reveals that IE7 has problems with positioning and printing. Take a look at the following links. They can point you in the right direction:

This post from ThaSaltyDawg from the second link looks the most informative, although it concerns another (?) IE7 print error:

Through a trial version and an error, I found a fix for my problem. It was CSS, as I already guessed. Using combinations of float, position, z-index and several other elements caused unexpected results in IE. Going to the Microsoft support page, I found that there is an error with IE.

In my case, using float with <table> incredulous in IE. It displays fine, but not so good for printing. Also make sure your position value is correct. And if you insert <table> and <div> , make sure your z-index is correct.

There is no real way to install these things, it depends on the use, because some of my pages had to have different settings.

Floats and absolutely positioned elements seem to give the most problems. That way, you probably just want to go with your earlier “decision” about changing the position attribute on the div (in the print stylesheet) and then work your way through the rest to fix the broken layout.

+2
source

OK ... I created a new CSS sheet and specified it for media = "print". In this stylesheet, I removed all formatting and navigation and completely printed the content. This works fine in IE7 and Firefox. Thanks to everyone who helped!

+3
source

Even with the print stylesheet, I found that IE7 (and sometimes IE8) ignores certain styles.

After a little testing, it seems because the class names I mentioned were in html5 tags. If you have wrapping divs, you can just target them, which seemed to solve the problem for me.

0
source

All Articles