html - 如何排列要打印的 html 文档,这样页面就不会被截断?

标签 html css iframe layout printing

我在 iframe 中有一个 HTML 文档,人们将打印出来,我已经对其进行了编码,使其在打印时看起来不错。有一个页脚和一个页眉,每个页面的页眉都会发生变化,每个页面都在它自己的 div 标签中。我希望人们能够点击文档的打印按钮,并且每个页面都打印在自己的页面上而不会被切断,并确保页脚位于每页的底部。有没有办法做到这一点?我希望得到一些帮助,因为它让我发疯!当一页太短时,看起来很糟糕,所以下一页将打印在同一页上,然后在中途被切断。

这是我设置它的地方.. http://morecleanenergy.com/graphics/testproposal/index.html

这是其中一个页面..

<div style="size:210mm 297mm;">
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="Proposalheader">
        <tr>
            <td align="left" width="169"><img src="faq.png" height="57px"></td>
            <td width="732"></td>
        </tr></table>
    <div class="pageBody">
        <span class="generalText"><p><strong>Who is Clean Energy Collective?</strong></p>
            <p>Clean Energy Collective (CEC) is a Colorado-based company that develops, operates and maintains community-owned solar arrays, also referred to as solar gardens or community solar farms. CEC's innovative model makes local renew- able energy easy, accessible and a financially smart decision for electricity consumers in the United States.</p>
            <p><strong>What is CEC Community Solar?</strong></p>
            <p>Clean Energy Collective community solar enables you to own solar panels in a centralized, community-based array. As your panels produce clean electricity, you receive credits directly on your monthly electric bills for the power produced. By owning a solar power system in a community array, you can reduce or eliminate your electric bills, protect against rising prices, and experience monthly savings in place of a monthly expense.</p>
            <p><strong>What happens to the electricity produced by the panels?</strong></p>
            <p>The clean solar power is automatically delivered to the Xcel Energy's grid, increasing the utility's incorporation of renewable energy and decreasing its reliance on fossil fuels. The power is not delivered directly to your meter and no equipment is required to be installed on your property.</p>
            <p><strong>Do I need to own a home or building to participate?</strong></p>
            <p>No. If you have an electric bill, you can receive credits for the power produced by solar panels in a CEC communi- ty-owned solar array.</p>
            <p><strong>How can I monitor my panels' performance?</strong></p>
            <p>As a CEC customer, you can log on to your My Own Clean Energy account via the CEC website and smartphone app. There you can see your system's information, review your customer documents, and access real-time information about your portion of the array's production, bill credits, and positive environmental impact.</p>
            <p><strong>What happens if I move?</strong></p>
            <p>If you move within your county, simply have your panels' bill credits applied to your new location's meter and account with the utility. If you leave the county or the Xcel Energy territory, you may sell the panels to another Xcel Energy customer in your county or give a tax-deductible gift of clean energy by donating the system to a charity in your county.</p>
            <p><strong>How much solar can I buy?</strong></p>
            <p>Systems are available from a minimum of 1 kilowatt (kW) up to 120% of your average annual usage.</p>
            <p><strong>How are my monthly electric bill credits calculated?</strong></p>
            <p>Each month, your Xcel Energy electric bill will be credited for your panels' production. The power produced is credited at the specific rate for your customer class as determined under Xcel Energy's Solar*Rewards Community Program. These initial credit rates will increase as Xcel Energy's electricity rates increase, protecting you against the national trend of rising electricity costs.</p>
            <p><strong>How are my monthly electric bill credits calculated?</strong></p>
            <p>As Xcel Energy's electricity prices rise, the bill credit rate you receive for the panels' output will increase as well. As your monthly bill credits increase, your system's savings increase.</p></span>
    </div>
    <div><img src="footer.png" style="width:100%;"></div>
</div>

最佳答案

尝试将 page-break-after CSS 属性应用于页脚。 http://www.w3schools.com/cssref/pr_print_pageba.asp

关于html - 如何排列要打印的 html 文档,这样页面就不会被截断?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26783479/

相关文章:

javascript - 移动 Web 应用程序 - 多页面还是 AJAX?

javascript - 绑定(bind) src 时视频或 iframe 标签无法正常工作

Javascript-在设置的超时后执行 onscroll 函数

html - 我可以组合两个不同的 DOM 来组合选择器 :nth-child with combined indexes?

javascript - IE8 不在插入内容时重新计算 div 的大小

iframe - 在 Selenium WebDriver 中访问 iFrame 文档内的元素

html - 从 chrome 的扩展内容脚本访问 iframe 内容

html - 类似的子组件不会从路由器导出加载

html - 将 <br> 替换为使其宽度适应容器 : possible? 的水平线

javascript - iframe 在小型设备上无法正常运行