我有一个在 IE6/7 和 Firefox 3.5 中呈现良好的页面。IE6 和 Firefox 3.5 打印页面都没有问题,但 IE7 可以。打印页面时,我的内容 div 的前半部分不可见,但显示的两个表格除外。内容开始重新出现在句子中间,没有任何标签或中断。
这几乎就像隐藏了 div 的前半部分但让表格显示出来的东西。但是,我没有不合适的标签、没有神奇的空浮动 div 或任何类型的验证错误,而且我还有其他几个使用相同 CSS 的页面都可以正常打印。
有没有人经历过类似的事情?你是怎么解决的(如果你没有因为沮丧而放弃的话)?
编辑:我终于有更多的时间来研究这个问题,而且我已经很好地缩小了问题的范围。我可以通过执行以下两项操作之一来显示所有文本:将 div 的“位置”样式属性更改为“绝对”以外的其他内容(这会导致定位完全错误),或者通过注释掉少量的内容。
这里是可以注释掉的内容...
<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 (i.e., optional activities, trip extensions, conference registration fees, etc.), “MT” 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>
希望对你的帮助比对我的帮助更大。假设我今天没有被卷入其他事情,我将尝试使用 CSS 来解决问题。
编辑:屏幕!
第一个是页面当前的打印方式。我把XXXX放在内容重新出现的页面上;我也把它放在上面的代码中。如果你稍微眯起眼睛就能看到它。
http://img109.imageshack.us/img109/589/current.jpg
第二个是如果我将内容 div 的 CSS 位置从绝对值更改为相对值,页面将如何打印。
http://img514.imageshack.us/img514/9961/modcss.jpg
第三个是如果我注释掉“Broken Part”,页面的打印方式。也就是说,刚刚好。