css - Zurb Foundation 5 媒体打印的分页符

标签 css printing zurb-foundation

我想使用 Foundation 5 ccs 框架从我的站点打印一些页面。在我的 CSS 中,我添加了以下行:

@media print {
   hr.page-break{page-break-after:always!important;}      
}

我使用 .page break 类来简单地添加新页面进行打印,但没有用。 当删除所有基础 5 样式时,新页面按预期打印。有什么想法吗?

最佳答案

这些是 F5 的唯一打印样式(来自 /foundation/components/_type.scss)所以我没有看到任何与 hr 相关的内容.

  @media print {
    * {
      background: transparent !important;
      color: #000 !important; /* Black prints faster: h5bp.com/s */
      box-shadow: none !important;
      text-shadow: none !important;
    }

    a,
    a:visited { text-decoration: underline;}
    a[href]:after { content: " (" attr(href) ")"; }

    abbr[title]:after { content: " (" attr(title) ")"; }

    // Don't show links for images, or javascript/internal links
    .ir a:after,
    a[href^="javascript:"]:after,
    a[href^="#"]:after { content: ""; }

    pre,
    blockquote {
      border: 1px solid #999;
      page-break-inside: avoid;
    }

    thead { display: table-header-group; /* h5bp.com/t */ }

    tr,
    img { page-break-inside: avoid; }

    img { max-width: 100% !important; }

    @page { margin: 0.5cm; }

    p,
    h2,
    h3 {
      orphans: 3;
      widows: 3;
    }

    h2,
    h3 { page-break-after: avoid; }

    .hide-on-print { display: none !important; }
    .print-only { display: block !important; }
    .hide-for-print { display: none !important; }
    .show-for-print { display: inherit !important; }
  }

另外 - 不相信这应该重要,但我从未见过 !important 的选择附加到一个值而中间没有空格,所以我会放一个空格那里。

关于css - Zurb Foundation 5 媒体打印的分页符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20684803/

相关文章:

javascript - 尝试创建一个 jQuery 插件来动态填充 Foundation 模态中的图像

javascript - Ember.js - 渲染模态视图,URL 和父 View 仍然显示

css - 使用 css 缩小子图像时,IE8 中的容器保留原始图像宽度

javascript - 使用javascript打印图像

python - 在 Python 中打印新行对齐的字符串

html - 为什么 <hr> 在 prod 模式下与 watch 模式下不同?

android - 无法使导航按钮在 lg 和 md View 上消失,无法下拉菜单按钮

html - 寻找适用于 Bootstrap 的良好 float 标签实现

html - 伪元素未出现在代码中之后

基于云台的绘画机的数学编程帮助