Below is my code:
<!DOCTYPE html>
<html>
<head>
<style>
@media print
{
.page-break { display:block; page-break-inside: avoid;}
}
}
</style>
</head>
<body>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>This is some text.</p>
<p>---------------------------------------------------------.</p>
<div class="page-break">
<p>This is some text in a div element.</p>
<p>This is some text in a div element.</p>
<p>This is some text in a div element.</p>
<p>This is some text in a div element.</p>
<p>This is some text in a div element.</p>
<p>This is some text in a div element.</p>
<p>This is some text in a div element.</p>
<p>This is some text in a div element.</p>
</div>
<p>This is After div..........................</p>
</body>
</html>
I want to display my DIV freshly if it is split into 2 pages ONLY. I used above code but not working in print preview.