html - 在具有绝对定位的 FF 上打印问题

标签 html firefox printing css css-position

我在打印使用 FF 中的绝对定位创建的表单时遇到了一些问题。我在 A4 纸上打印。如果它的单页形式,页面就很好,但是当我必须打印多页形式时,只打印第一页,而必须出现在第二页上的其他元素在下一页的单行中相互覆盖。很奇怪,同样在 IE 上工作正常

注意我无法共享 html,因为它包含大量 css 以及相当复杂和庞大的 HTML 页面。

  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
@-moz-document url-prefix() {div{position:relative} }
@media print { marquee { -moz-binding: none; } body{overflow:visible !important;} }
#a{
position:absolute;
top:50px;
left:70px;
}
#b{
position:absolute;
top:1050px;
left:170px;
}
#d{
position:absolute;
top:1650px;
left:270px;
}
#c{
position:absolute;
top:1550px;
left:470px;
}

</style>
</head>
<body>asdasd
<div id="a">aa</div>
<div id="d">bb</div>
<div id="b">ff</div>
<div id="c">asd</div>
asdasda
</body>
</html>

最佳答案

有一个主题已经讨论过的线程: Firefox printing only 1st page

但是,问题可能出在 css 中。 如此处所述 http://briancaos.wordpress.com/2008/12/05/firefox-only-prints-first-page-of-contents/

如果你有一个

overflow: hidden;

在你的CSS中,把它改成

overflow:visible;

然后它应该可以工作了。

关于html - 在具有绝对定位的 FF 上打印问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8398155/

相关文章:

jquery - 位置固定的顶部导航栏在 Firefox 中表现异常

printing - 通过蓝牙或 USB 与打印机设备通信并控制打印机设备

python - 在 PyQt 中打印图像时出错

css - 简单的CSS时尚打印问题

javascript - 在html中使用 "&times"字改成×

javascript - HTML5 选择多个高度以适合内容

javascript - Firefox 中的异步文件上传会在任何 DOM 更改时重置

html - 按钮在 chrome 中工作但在 mozilla 中不起作用

javascript - 如何通过 html 中的单选按钮将简单的 int 变量存储在服务器上?

javascript - 为什么 Firefox 在从 JavaScript 加载时会更改表单标签属性?