page-break-before和page-break-after CSS属性并不会修改网页在屏幕上的显示,这两个属性是用来控制文件的打印方式。每个打印属性都可以设定4种设定值:auto、always、left和right。其中Auto是默认值,只有在有需要时,才需设定分页符号 (Page breaks)。page-break-before若设定成always,则是在遇到特定的组件时,打印机会重新开始一个新的打印页。page-break-before若设定成left,则会插入分页符号,直到指定的组件出现在一个左边的空白页上。page-break-before若设定成right,则会插入分页符号,直到指定的组件出现在一个右边的空白页上。page-break-after属性会将分页符号加在指定组件后,而非之前。在下列

程序中您将可以看到这些属性的设定:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div>This is the first div.</div>
<div STYLE="page-break-before:always">This is the second div.</div>
<div STYLE="page-break-after:always">This is the third div.</div>
<div>This is the fourth div.</div>
<div STYLE="page-break-before:right">This is the fifth div.</div>
<div STYLE="page-break-after:right">This is the sixth div.</div>
<div>This is the last div.</div>
</body>
</html>

可用值

值 描述
auto Insert a page break after the element if necessary

假如需要在对象之后插入页分割符
always Insert a page break after the element

始终在对象之后插入页分割符
avoid Avoid inserting a page break after the element

避免在对象后面插入页分割符
left Insert page breaks after the element until it reaches a blank left page

在对象后面插入页分割符直到它到达一个空白的左页边
right Insert page breaks after the element until it reaches a blank right page

在对象后面插入页分割符直到它到达一个空白的右页边

转载地址:http://blog.163.com/fan_yishan/blog/static/4769221320091043619358/

page-break-before和page-break-after 实现分页打印的更多相关文章

  1. SharePoint2013 Set a custom application page as site welcome page

    本文主要介绍如何添加一个custom application page as site welcome page 1.首先创建一个sharepoint 2013 empty solution, add ...

  2. 2016/05/17 thinkphp3.2.2 分页的使用:①在Home下设置Publics文件夹或在thinkPHP下library的vender 把page.class.php 考贝进入 ②通过new 实例化方式调用 $page=new \Home\Publics\Page($total,3);

    注意分页的方法有两种:一种是thinkphp3.2 自带的   另一种是之前新闻页用过的     显示效果稍有差别 显示效果: 细节问题: ①搜索页面  要加session判断   和  分页 ②修改 ...

  3. Page.ClientScript.RegisterStartupScript 与 Page.ClientScript.RegisterClientScriptBlock 之间的区别

    Page.ClientScript.RegisterClientScriptBlock 在页面紧跟<form>之后,整个页面未完全加载完成. Page.ClientScript.Regis ...

  4. 使用Spring JPA中Page、Pageable接口和Sort类完成分页排序

    显示时,有三个参数,前两个必填,第几页,一页多少个size,第三个参数默认可以不填. 但是发现这个方法已经过时了,通过查看它的源码发现,新方法为静态方法PageRequest of(page,size ...

  5. [转]Repeat Page Header on each Page for reports SSRS

    本文转自:https://stackoverflow.com/questions/3475144/i-want-to-repeat-page-header-on-each-page-for-repor ...

  6. leetcode 139. Word Break 、140. Word Break II

    139. Word Break 字符串能否通过划分成词典中的一个或多个单词. 使用动态规划,dp[i]表示当前以第i个位置(在字符串中实际上是i-1)结尾的字符串能否划分成词典中的单词. j表示的是以 ...

  7. 139. Word Break 以及 140.Word Break II

    139. Word Break Given a non-empty string s and a dictionary wordDict containing a list of non-empty  ...

  8. nginx rewrite 指令last break区别最详细的解释

    转自:http://blog.sina.com.cn/s/blog_4f9fc6e10102ux0w.html http://blog.cafeneko.info/2010/10/nginx_rewr ...

  9. Operating System Memory Management、Page Fault Exception、Cache Replacement Strategy Learning、LRU Algorithm

    目录 . 引言 . 页表 . 结构化内存管理 . 物理内存的管理 . SLAB分配器 . 处理器高速缓存和TLB控制 . 内存管理的概念 . 内存覆盖与内存交换 . 内存连续分配管理方式 . 内存非连 ...

  10. mysql 数据库封装类:返回索引、关联、字符串数组;分页查询封装类 :$page=new Page(表的总条数,每页的条数);$sql = "".$page->limit; echo $page->fpage();

    <?php class czy { public $host="localhost"; //地址 public $uid="root"; //用户名 pu ...

随机推荐

  1. 015.Oracle数据库,取本月月初,取本月月末

    /*取本月月初,取本月月末*/ SELECT trunc( SYSDATE, 'mm' ) AS 月初 , last_day(trunc(sysdate)) AS 月末 FROM dual; 修改如下 ...

  2. leetcode102 Binary Tree Level Order Traversal

    """ Given a binary tree, return the level order traversal of its nodes' values. (ie, ...

  3. iPhone Safari下iframe不显示滚动条无法滚动的解决方法。iframe的坑!

    <div class="dataTables_wrapper" style="-webkit-overflow-scrolling:touch;overflow:a ...

  4. Codeforces Round #611 (Div. 3)

    原题面:https://codeforces.com/contest/1283 A.Minutes Before the New Year 题目大意:给定时间,问距离零点零分还有多久? 分析:注意一下 ...

  5. C++面试常见问题——02动态分配内存

    动态分配内存 C++动态内存 C++程序中内存分为两个部分 堆:程序中未使用的内存,在程序运行时可用于动态分配内存. 栈:函数内部申明的所有变量都将占用栈内存. 很多时候不知道一个程序到底需要多少内存 ...

  6. [LeetCode] 929. Unique Email Addresses 独特的邮件地址

    Every email consists of a local name and a domain name, separated by the @ sign. For example, in ali ...

  7. 六十三、SAP中的逻辑运算符

    一.SAP中逻辑运算符包括AND, NOT, OR 二.输出如下

  8. > 1> 2> &> /dev/null Linux重定向输出

    编译模拟器的 LINK 阶段产生了大量错误信息,定位不到第一行,所以将错误重定向到了一个文件: scons build/X86_VI_hammer_GPU/gem5.opt --default=X86 ...

  9. 关于C#设计SQllite

    使用3.5框架+System.Data.SQLite,System.Data.SQLite.Ling+SQLite.Designer三个dll

  10. vue学习(一)ES6常用语法

    1 ES6常用语法 1.1 变量提升 例① # 变量提升 <div id="app"> </div> <script> console.log( ...