Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
 Discussion Forums
 HTML, XML, JavaScript...
 Software Reviews
 Editors,Others...
 Top100
 JavaScript Tutorials, ...
 Tutorials
 ASP, CSS, Databases...
 Discussion List
 FAQ, Roundup, Configure ...
 Authoring
 HTML, JavaScript, CSS...
 Design
 Layout, Navigation,...
 Graphics
 Tools, Colors, Images...
 Software
 Browsers, Editors, XML...
 Internet
 Domains, E-Commerce, ...
 WDVL Resources
  Intermdiate, Tutorials,...
 WDVL
 Discussion Lists, Top 100,...
 Technology Jobs


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Top 10 Articles
  1. Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
  2. JavaScript Tutorial for Programmers
  3. Design
  4. JavaScript Tutorial for Programmers - Objects
  5. JavaScript Tutorial for Programmers - JavaScript Grammar
  6. JavaScript Tutorial for Programmers - Versions of JavaScript
  7. Cascading Style Sheets
  8. JavaScript Tutorial for Programmers - Embedding JavaScript
  9. JavaScript Tutorial for Programmers - Functions
  10. Authoring JavaScript
Domain Name Lookup
Search to find the availability of a domain name. Just enter the complete domain name with extension (.com, .net, .edu)

Printing and Paginated Media

October 30, 2000

Earlier in this chapter, we talked about media groups. One of these media groups dealt with presentation to continuous and paginated media.

As we said before, paginated media is different from continuous media in that the document content is split into discrete 'pages' when it is rendered. Continuous media, as its name implies, does not split the document content, keeping it as one continuous entity when it is rendered.

In summary, there are three ways of handling printed media:

  • print media type
  • page breaking properties
  • @page rule
You can use any or all of these methods when creating a document.

The print media type allows us to change the presentation of the document: things like whether to use a serif or a sans-serif font, which the font-size, background-colors, etc. We talked about the print media type and other media types earlier in this chapter.

The page breaking properties allow us to relate how content is displayed on the pages defined by the @page rule: things like avoiding page breaks before certain elements and forcing an image to appear on a right-hand page, etc.

The @page rule allows you to define the context for printing – in essence, it allows you to describe the paper: things like the size of the paper, its margins, and so on.

We will learn about the @page rule and the page breaking properties in the following sections.

Page Breaking Properties

Page breaking properties provide a way for us to control where page breaks (i.e. where one page ends and the next one begins) occur when our document is printed. New sections and chapters often begin on new pages and you may wish to control page breaks around images (perhaps forcing a page break before an image or preventing a page break following an image).

For example, if we want to make a paragraph start on a new page, we would write:

<p style="page-break-before: always">
  This is the first paragraph of text on a new page.
 </p>
In this example, we set the page-break-before property to always, which means that a page break will always occur before this paragraph.

You can also use style sheets, as in this example:

   h1 { page-break-before: always }
This means that every level-one header will start on a new printed page.

There are several page breaking properties:

  • page-break-before
  • page-break-after
  • page-break-inside
  • orphans
  • widows
Each of these properties can have different values that affect whether the page break occurs all of the time or under special conditions.

The 'page-break-before' and 'page-break-after' Properties

As you can guess, the page-break-before property controls whether a page break occurs before an element. Likewise, the page-break-after property controls whether a page break occurs after an element. Both of these properties can have one of the following values and meanings:

Value page-break-before page-break-after
"auto" A page break should not be forced or forbidden before the element. A page break should not be forced or forbidden after the element.
"always" A page break should be forced (always occur) before the element. A page break should be forced (always occur) after the element.

Value page-break-before page-break-after
"avoid" A page break should be avoided before the element. A page break should be avoided after the element.
"left" One or more page breaks should be forced so that the element appears on the left hand page. One or more page breaks should be forced so that the content appearing after the element appears on the left hand page.
"right" One or more page breaks should be forced so that the element appears on the right hand page. One or more page breaks should be forced so that the content appearing after the element appears on the right hand page.

Creating Media-Dependent Style Sheets
Beginning XHTML
Using the 'page-break-before' Property


Up to => Home / Authoring / Languages / XML / BeginningXHTML




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers