Page breaks for print

by Kevin Partner on 14th April, 2008

If you’re styling pages for print, you will need to control where the printed pages break. Here’s how to do it:

<div style=”height:1px”>&nbsp;</div>
<div id=”page 1″ style=”page-break-after: always”>
content goes here
</div>

I’m told the initial div (with the height of 1px) is needed in IE6 and haven’t yet tested whether this is true. All I can tell you is that this works in IE7 and Firefox. Put the complete content of the page within the DIV and the browser will force a page break once the div tag closes.

Share and Enjoy:
  • Print
  • Twitter
  • Facebook
  • Digg
  • del.icio.us
  • Google Bookmarks
  • Technorati
  • Add to favorites

Leave a Comment

Previous post:

Next post: