spacer
Yehuda Shiran January 31, 2000
Page Breaks in Printing
Tips: February 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Google Going Native With Chrome
Mozilla Fixes Firefox Flaws as 3.5 Release Nears
Microsoft and Novell Still Bosom Buddies

In order to insert page breaks when the document is printed, you need to use the page-break-before and page-break-after CSS styles. These styles only work with the following block elements: BLOCKQUOTE, BODY, CENTER, DD, DIR, DIV, DL, DT, FIELDSET, FORM, Hn, LI, LISTING, MARQUEE, MENU, OL, P, PLAINTEXT, PRE, UL, and XMP. Here is an example that works with the P tag:

<HTML>
<HEAD><TITLE>Dynamic Styles: Page Breaking</TITLE>
<STYLE>
  P.page {page-break-after: always}
</STYLE>
</HEAD>
<BODY>
<P CLASS=page>
    .
  content on page 1
    .
</P>
    .
  content on page 2
    .
    .
</P>
</BODY>
</HTML>

Learn more about printing Web pages in our tip from October 29, 1999.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
XML and PHP Simplified · Creating a ASP.NET Contact Form · Data Filtering with PHP
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Intel to Host Live Nehalem Q&A · 12 Tips to Troubleshoot Network File-Sharing · 10 Tips for Selling on Kijiji