@page CSS样式不适用于Mozilla firefox
问题描述:
我的要求是在打印时在所有页面上留出10厘米的空白.
我正在使用window.print()进行打印.我的网页会动态增加(因此无法确定页面数).对于所有页面,我需要提供10厘米的页边空白.
我使用CSS Media ="Print",在其中定义了样式:
My requriment is to provide 10cm margin to all the page when printing.
I''m printing using window.print(). My web page will dynamically increase (so number of pages cannot be determined). For all the pages I need to provide margin of 10 cm.
I used CSS Media="Print", within which I defined the style:
@page
{
Margin-top :10cm;
}
这适用于Mozilla firefox以外的所有浏览器.我搜索了解决方案,所有博客都说,Mozilla将不支持@page,但不支持解决方案.有人可以帮我吗?
This is working in all the browsers except Mozilla firefox. I searched for solutions and all the blogs say, Mozilla will not support @page, but No Solution. Can someone help me on this?
答
正确.看起来即使壁虎支持@media本身(至少对于某些属性),但@page却不支持:
http://en.wikipedia.org/wiki/CSS_support [
Right. It looks like even though @media itself is supported by Gecko (at least for some properties), @page is not:
http://en.wikipedia.org/wiki/CSS_support[^].
That''s a pity :-(—SA