page-break-after: auto | always | left | right | avoid | initial | inherit;
值 | 说明 |
auto | 这是默认值,必要时在元素后插入分页符。 |
always | 它指定元素之后强制分页。 |
left | 它用于避免在元素之后分页。 |
right | 它会在指定元素后强制分页一次或两次,以便将下一页描述为左侧页面。 |
avoid | 它会在指定元素之后强制分页一次或两次,以便将下一页显示为右侧页面。 |
initial | 它将属性设置为其默认值。 |
inherit | 如果指定了此值,则对应的元素将使用其父元素的计算值。 |
<html>
<head>
<style type="text/css">
div {
font-size: 20px;
page-break-after: auto;
}
</style>
</head>
<body>
<div>
<h2>Hello World!!</h2>
<h2>Welcome to the bianchenghao6.com.</h2>
</div>
<div>
This site is developed so that students may learn computer science related technologies easily. The bianchenghao6.com is committed to providing easy and in-depth tutorials on various technologies. No one is perfect in this world, and nothing is eternally best. But we can try to be better.
</div>
<br>
<button onclick="func()">printthis page</button>
<script>
function func() {
window.print();
}
</script>
</body>
</html>
<html>
<head>
<style type="text/css">
div {
font-size: 20px;
page-break-after: always;
}
</style>
</head>
<body>
<div>
<h2>Hello World!!</h2>
<h2>Welcome to the bianchenghao6.com.</h2>
</div>
<div>
This site is developed so that students may learn computer science related technologies easily. The bianchenghao6.com is committed to providing easy and in-depth tutorials on various technologies. No one is perfect in this world, and nothing is eternally best. But we can try to be better.
</div>
<br>
<button onclick="func()">printthis page</button>
<script>
function func() {
window.print();
}
</script>
</body>
</html>
<html>
<head>
<style type="text/css">
div {
font-size: 20px;
page-break-after: left;
}
</style>
</head>
<body>
<div>
<h2>Hello World!!</h2>
<h2>Welcome to the bianchenghao6.com.</h2>
</div>
<div>
This site is developed so that students may learn computer science related technologies easily. The bianchenghao6.com is committed to providing easy and in-depth tutorials on various technologies. No one is perfect in this world, and nothing is eternally best. But we can try to be better.
</div>
<br>
<button onclick="func()">printthis page</button>
<script>
function func() {
window.print();
}
</script>
</body>
</html>
<html>
<head>
<style type="text/css">
div {
font-size: 20px;
page-break-after: right;
}
</style>
</head>
<body>
<div>
<h2>Hello World!!</h2>
<h2>Welcome to the bianchenghao6.com.</h2>
</div>
<div>
This site is developed so that students may learn computer science related technologies easily. The bianchenghao6.com is committed to providing easy and in-depth tutorials on various technologies. No one is perfect in this world, and nothing is eternally best. But we can try to be better.
</div>
<br>
<button onclick="func()">printthis page</button>
<script>
function func() {
window.print();
}
</script>
</body>
</html>