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. Day6 - H - Balanced Lineup POJ - 3264

    For the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One d ...

  2. Day6 - E - Brownie Points II POJ - 2464

    Stan and Ollie play the game of Odd Brownie Points. Some brownie points are located in the plane, at ...

  3. canon 打印机 连接不上 netgear 路由器

    解决方法很简单,只要把信道设置到 10以内即可.

  4. Tornadao Cookie

    cookie的详细介绍.Tronado带签名的cookie原理.基于cookie实现用户验证 cookie详细介绍 cookie本质就是存于浏览器的 键值对. 特性: 每次http请求服务端的时候,都 ...

  5. python基础数据类型--列表(list)

    python基础数据类型--列表(list) 列表是我们在后面经常用到的数据类型之一,通过列表可以对数据类型进行增.删.改.查等操作 一列表的增.删.改.查 1增: 1.1增加到最后   append ...

  6. GNS3 ip route 命令解析

    ip route 120.94.0.0 255.254.0.0 172.16.252.1ip route 192.168.0.0 255.255.0.0 10.10.10.119ip route 21 ...

  7. MySQL每日执行

    drop event if exists upload_deadline; DELIMITER $$ create event upload_deadline day starts timestamp ...

  8. Python中的numpy函数的使用ones,zeros,eye

    在看别人写的代码时,看到的不知道的函数,就在这里记下来. 原文是这样用的: weights = ones((numfeatures,1)) 在python中help(): import numpy a ...

  9. php知识结构

    PHP的运行环境 连环境都搞不起来,就是你有多么喜欢PHP,那也是白搭,开始我们大多会使用集成环境软件例如xampp,wamp.随着知识的增加慢慢要学会自己搭建运行环境,例如 Linux(Ubuntu ...

  10. C# ------ MEF

    参考 参考 MEF全称Managed Extensibility Framework, 是一个用于创建可扩展的轻型应用程序的库.开发人员可以利用MEF发现并使用扩展,但并不需要配置,而且还可以在应用程 ...