Nik's Technology Blog

Travels through programming, networks, and computers

Adding Page Breaks to HTML Documents

Using the CSS style attribute "page-break-before" you can place page breaks within your document, enabling the web designer to control how the document prints.

For example you could add them to <hr> tags as an in-line style or as part of your external CSS document.

SYNTAX

INLINE STYLE

<hr style="page-break-before: always">

OR IN CSS

hr {page-break-before: always;}

Compatible with Internet Explorer 4 upwards and Netscape 6/Mozilla.

W3 Schools reference to "page-break-before"