【问题标题】:How to achieve variable dynamic height for header in pdf with position :fixed如何在具有位置的pdf中实现标题的可变动态高度:固定
【发布时间】:2014-07-08 15:39:29
【问题描述】:

我在 pdf 报告中有一个标题,当标题被编辑时,标题的高度将保持不变,而我的 header.html.erb 看起来像这样 -

<div id="custom_header">
  <div style="margin-top: 30px;"></div>
  <%= HeaderFooterDesign.custom_header %>
</div>

<style>
  #custom_header {
    position: fixed;
    top: 0px;
    left: 0;
    bottom:0;
    width: 100%;
    height:200px;
  }

  body {
    top: 0px;
    height:200px;
    width: auto;
  }

现在我给出了高度:200px;在css中,如果高度更大或高度超过给定的限制,标题将正确显示到某个给定高度,然后标题不会显示在pdf报告中所以我正在寻找dynamic height with position fixed factorsDont want Scroll header所以任何人都可以帮助我

【问题讨论】:

    标签: ruby-on-rails css wicked-pdf


    【解决方案1】:

    在普通的 css 中,您可以使用 min-height: 200px。 但是由于分配给 pdf 的上边距是由边距的配置定义的……您需要考虑到这一点。 您可以查看这篇文章,它是关于更改页脚边距空间的,但它可以帮助您找到答案 wicked_pdf: footer height/styling

    【讨论】:

      猜你喜欢
      • 2021-12-20
      • 1970-01-01
      • 1970-01-01
      • 2012-07-02
      • 2017-10-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-31
      相关资源
      最近更新 更多