Printing - Notes - Web Development - Neils Resource WebPrinting - Notes - Web Development - Neils Resource WebPrinting - Notes - Web Dev. - Neils Resource Web


Summary of Content
As far as I know this CSS command can be used by most browsers. Bearing in mind most browsers will have their own print functionality (e.g. I.E.7's fit to page occasionally:)

A double mouse click anywhere on the page (except when over hyperlinks) will take you back to the top.


Setting A Specific Page Break
If you'd like a page break at a specific point to keep a particular look. You do that by setting up a class of page breaks.
You can set up the class on any HTML command, but probably the best method is to set up the class within a <BR> or <P> command. That way there's some white space where the page can break. This is the format (placed between your <HEAD> tags):

<STYLE TYPE="text/css">
     P.breakhere {page-break-before: always}
</STYLE>

This will be the activator for the page break:
<P CLASS="breakhere">
You can set up as many different classes as you'd like as long as you keep following the same format as above.
Available Commands

page-break-after

page-break-before

Each command has four attributes: always | auto | left | right

  • always tells the browser to break the print page after this element always.
  • auto is the default. You're telling the browser to do what it would do anyway: Page break where the page ends.
  • left is not supported by any browser yet. It is used if your printer will print both sides of a page, like a manuscript. If the page is a left-facing page, use this attribute.
  • right is what you would use if it's a right-facing page.
Some Suggestions
Make a Page for Printing
     Create a basic a text-only page, or at least a page with limited images and no background.
Make the Page Printer-Friendly
     Lose all text colours and make sure the width of the page was no more than 500px, left justified, so that what was shown on the screen would print on the printed page in the same way.
Allow the User to Choose to Print
     Put text at the bottom or an icon that doesn't intrude.

Hyperlink titles may have been abbreviated, (right click on the link and select properties for the full URL)
Top of the PageTop of the PageA double mouse click anywhere on the page will take you back to the top (except when over hyperlinks)

Last Updated 04/03/2008 - Printing - Notes - Web Development - Neils Resource Web