page-break-inside: auto | avoid | initial | inherit;
值 | 说明 |
auto | 如果有必要,它是在元素内插入分页符的默认值。 |
avoid | 用于避免元素内的分页符。 |
initial | 它将属性设置为其默认值。 |
inherit | 如果指定了此值,则对应的元素将使用其父元素 page-break-inside 属性的计算值。 |
<html>
<head>
<style type="text/css">
div {
font-size: 20px;
page-break-inside: 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-inside: avoid;
}
</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>