在Firefox中打印字段集 [英] Printing fieldsets in firefox

查看:142
本文介绍了在Firefox中打印字段集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经添加了一些新的CSS到现有的项目(使用媒体=打印)在页眉。它是顺利和(一次!)IE是给予不错的,预期的结果,但火狐不... ...

问题是,我有一个fieldset包含而且Firefox完全拒绝(即使在最新版本中),以允许fieldset内的分页符。这意味着任何不适合在一个页面上的任何东西都会丢失...



我发现在已经开放3年的mozilla网站上确认的错误 - https://bugzilla.mozilla.org/show_bug.cgi?id=471015 - 但不能找到任何合理的解决方法...

任何建议之前,我期待删除字段集或类似的?

谢谢,
Dave

解决方案

据我猜测,它仍然在最新的 Nightly



您可以尝试类似于 IE Print Protector (也称为 html5shiv )。



http://www.iecss.com/print-protector/#how-it-works


要在打印中正确显示元素,在打印时,IE Print Protector临时
会替换支持后备元素(如div和
span)的HTML5元素。 IE Print Protector还会根据您现有的样式为这些元素创建一个特殊的
样式表;这个
意味着你可以在链接,
风格,@imports和@media中通过元素名称安全地设计HTML5元素。紧接着,IE Print Protector
将原来的HTML5元素还原到了页面,就在那里你还剩下
它。任何对这些元素的引用以及这些元素上的任何事件
都将保持不变。

Firefox 现在支持 onbeforeprint



因此,当 onbeforeprint 被触发时,您可以将字段集 s更改为 div s,或者其他东西。



我不确定这是多么可行,而且听起来很复杂。 p>

I've been adding some new css to an existing project (using media="print") in the page header. It's going smooth and (for once!) IE is giving nice, expected results, but Firefox does not...

The problem is that I have a fieldset which contains a lot of fields, and Firefox completely refuses (even in the latest version) to allow a page break inside the fieldset. This means anything that doesn't fit on one page is lost...

I've found the bug acknowledged on the mozilla website which has been open for 3 years - https://bugzilla.mozilla.org/show_bug.cgi?id=471015 - but can't find any reasonable workaround...

Any suggestions before I look to remove fieldsets or similar?

Thanks, Dave

解决方案

As I guessed, it's still broken in the latest Nightly.

You could try to do something similar to IE Print Protector (aka the widely used html5shiv).

http://www.iecss.com/print-protector/#how-it-works

To display elements correctly in print, IE Print Protector temporarily replaces HTML5 elements with supported fallback elements (like div and span) when you print. IE Print Protector also creates a special stylesheet for these elements based on your existing styles; this means you can safely style HTML5 elements by element name in links, styles, @imports and @media. Immediately after, IE Print Protector restores the original HTML5 element to the page, right where you left it. Any references to those elements and any events on those elements will remain intact.

Firefox now supports onbeforeprint.

So, when onbeforeprint is fired, you could change the fieldsets for divs, or something.

I'm not sure how viable this is, and it sure sounds complicated.

这篇关于在Firefox中打印字段集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆