CSS Print Profile

W3C Working Draft 22 July 2003

This version:
http://www.w3.org/TR/[YEAR]/WD-css-print-[ISODATE]
Latest version:
http://www.w3.org/TR/css-print
Previous Version (from the PWG):
http://www.pwg.org/xhtml-print/HTML-Version/CSS-Print.html
Editors:
Jim Bigelow, Hewlett-Packard Company

Abstract

This specification defines a subset of theCascading Style Sheets Level 2 [CSS2] andspecification with additions from the proposed features of CSS3 module: Paged MediaPaged Media Properties for CSS3 [PAGEMEDIA], specifically for printing to low-cost devices. It is designed for printing from mobile devices, where it is not feasible or desirable to install a printer-specific driver, and for situations were some variability between the device's view of the document and the formatting of the output is acceptable to provide a strong basis for rich printing results without a detailed understanding of each individual printer's characteristics .

This profile is designed to work in conjunction with XHTML-Print [XHTMLPRINT] and defines a minimum level of conformance as well as It also defines an extension set that provides stronger layout control for the printing of mixed text and images, tables and image collections.

Status of this document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. The latest status of this document series is maintained at the W3C.

All sections of this document are normative unless noted as informative.

This specification is a public Working Draft from the CSS working group, which is part of the Style activity and is released with the consensus of the group. It is based, in large part, on a work by the same name, CSS Print Profile [CSSPP] from the Printer Working Group (PWG), a program of the IEEE Industry Standard and Technology Organization.

Feedback is very welcome. Comments can be sent directly to the editor, but the mailing list www-style@w3.org (see instructions) is also open and is preferred for discussion of this and other drafts in the Style area.

Patent disclosures relevant to CSS may be found on the Working Group's public patent disclosure page.

This working draft may be updated, replaced or rendered obsolete by other W3C documents at any time. It is inappropriate to use W3C Working Drafts as reference material or to cite them as other than "work in progress". Its publication does not imply endorsement by the W3C membership.

To find the latest version of this working draft, please follow the "Latest version" link above, or visit the list of W3C Technical Reports.

Document Difference Marking Conventions

The following review conventions are used in this document:

  • The presentation of this sentence indicates how text that is not in the PWG's CSS Print Profile [CSSPP] is shown.
  • Text removed from the PWG's CSS Print Profile [CSSPP] is presented in the style of the following phrase, which may not be visible: " excised and deleted text is present this way".

This is an example of a comment or annotation written by the editor. The comment is meant to aide discussions of the document or improve understanding of it. This text will not appear in the final version.

Contents

1. Overview

All sections of this document are normative unless noted as informative.

This document specifies a profile of the Cascading Style Sheets, level 2 (CSS2) specification [CSS2] along withand selected portions of the CSS3 module: Paged MediaPaged Media Properties (PAGEMEDIA) [PAGEMEDIA] of Cascaded Style Sheets, level 3 (CSS3) specification [CSS3]. This profile is appropriate for a spectrum of printing devices from low cost printers to high-end printers. Conformance to this profile means that a user agent supports, at minimum, the features defined in this specification. This subject is addressed in Section 2, Conformance, below. As defined in [CSS2]:

CSS2 is a style sheet language that allows authors and users to attach style (e.g., fonts, spacing, and aural cues) to structured documents (e.g., HTML documents and XML applications). By separating the presentation style of documents from the content of documents, CSS2 simplifies Web authoring and site maintenance. CSS2 builds on CSS1 (see [CSS1]) and, with very few exceptions, all valid CSS1 style sheets are valid CSS2 style sheets. CSS2 supports media-specific style sheets so that authors may tailor the presentation of their documents to visual browsers, aural devices, printers, Braille devices, handheld devices, etc.

In summary, CSS2 specifies how developers can author style sheets for presenting documents across multiple devices and media types. While this is very important, it is also important that authors have an understanding of what features are supported on these different devices. Likewise, it is important that similar devices operate in a similar manner. Otherwise, authors will need to develop style sheets for each version of each device -- raising the cost of content development and decreasing interoperability.

The CSS Print Profile specifies a conformance profile for printing from mobile devices to low-cost printersing devices, identifying a minimum set of properties, values, selectors, and cascading rules. This profile was designed in conjunction with XHTML-Print ([XHTMLPRINT]) for low cost printers that may not have a full-page buffer and that generally print from top-to-bottom and left-to-right with the paper in a portrait orientation.

This profile also contains an enhanced layout extension set that is the companion of the XHTML-Print extension set ([XHTMLPRINT] , Section 2.4) and supports more exacting page layouts and orientations. The enhanced layout extension may require full page buffering within the printer.

Conformance to this profile means that a user agent supports, at a minimum, the features defined in this specification. This subject is addressed in Section 2, Conformance, below.

1.1 Glossary

PP-UA
A CSS Print Profile conforming user agent, that is, a printer.

2. Conformance

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY" and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 (see [RFC2119]). However, for readability, these words do not appear in all uppercase letters in this specification.

The primary role of a profile is to define a subset of features that provides a minimal guarantee of interoperability. In the case of the CSS Print Profile, this guarantee is that a conforming user agent will support the features defined in this specification following the CSS2 conformance clause ([CSS2] Section 3.2), recast and summarized below:

  1. A CSS Print Profile conforming user agent (PP-UA or more simply "printer") SHALL support the all and print CSS2 media types. A printerPP-UA MAY support other CSS2 media types, as well.
  2. For each source document, a printerPP-UA SHALL attempt to retrieve all associated style sheets that are appropriate for the supported media types. A failure to retrieve a style sheet due to problems such as a loss of network connection SHOULD NOT stop the printerPP-UA from processing the document.
  3. A printerPP-UA SHALL parse the style sheets according to this specification. In particular, the printerPP-UA SHALL recognize all CSS Print Profile at-rules, blocks, declarations, and selectors. If a printerPP-UA encounters a property that applies for a supported media type, the printerPP-UA SHALL parse the value according to the property definition. This means that the printerPP-UA SHALL accept all valid values and MAY ignore declarations with invalid values. A printerPP-UA SHALL ignore rules that apply to unsupported media types.
  4. For each element in a document tree, the printerPP-UA SHALL assign a value for every applicable property according to the property's definition and the rules of cascading and inheritance.
  5. If the source document comes with alternate style sheets (such as with the "alternate" keyword in HTML 4.01 [HTML4]), the printerPP-UA MAY ignored the style sheet or treat it in some implementation dependent manner.

As with CSS2, there are qualifications to this conformance clause:

  1. Values MAY be approximated when REQUIRED by the printerPP-UA.
  2. The inability of a printerPP-UA to implement part of this specification due to the limitations of a particular device (e.g., a printerPP-UA cannot render colors on a monochrome page) SHALL NOT imply non-conformance.

It is RECOMMENDED that authors use this conformance profile to take advantage of forward compatibility. Authors MAY use style properties with an understanding that the cascading rules are processed correctly and that unknown properties and values are ignored. For example:

  body {
    background-position: center center;
    background-position: 45% 55%;
  }
 

A printerPP-UA that can accept percentage values for the background-position property will process the first background-position declaration and then replace that value with the second background-position declaration. A printerPP-UA that cannot accept percentage values will process the first background-position declaration and ignore the second background-position declaration.

Each CSS construct in the following sections is annotated to indicate how it SHOULD be treated by a conforming printer:

Key Description
MUSTYes Support is mandatory; a conforming printerPP-UA MUST honor this propteryattribute, although the values mandated for support MAY be a subset of the full range.
SHOULD The property is concerned with functionality that SHOULD be implemented but MAY be beyond the capability of a conforming printerPP-UA. For example, a monochrome printer can only render a gray scale equivalent of color images.
MAY The property's functionality is considered too complex, either in processing or memory requirements, for a printerPP-UA. For example, vertical alignment within table cells in table rows that span multiple pages could exceed a low cost printer's available memory.
N/ANo The construct does Not Apply to the printed pageSupport is optional; a conforming printer MAY ignore this construct for one of the following reasons, but cannot treat it as an error:
  • The construct references some functionality that is not possible on the printed page, such as volume or :hover.
  • The attribute is not needed because the document encoding is restricted to Unicode.
  • The construct is part of functionality that is deemed too complex for low cost printers, such as language specific processing, printing on landscape oriented pages, buffering of images for later use, or vertical alignment of cell data in tables that span multiple pages.

2.1. Enhanced Layout Extension Conformance

SomeTo further support print applications requireing a more exacting page layout than is available from a conforming printerPP-UA (e.g., photo album pages or pages from a digital TV)., The Enhanced Layout Extension increases the number of properties that a conforming printer MUST support and thereby the requirements of its memory and performance capabilities. These addedthe CSS constructs are indicated with a "MUSTYes", or an increased range of values, in the CSS Print-Enhanced columns below.MAY be supported in

Printers supporting the Enhanced Layout Extension MUST also support the XHTML-Print Enhanced Layout Extension ([XHTMLPRINT], Section 2.4) and MAY also support an OPTIONAL, discoverable (via some means outside the scope of this document) Enhanced Layout Extension indicator. If support for this extension is indicated, all of the following properties marked with " MUST" for CSS Print-Enhanced, MUST be supported.

3. Selectors

In CSS2, pattern matching rules determine which style rules apply to elements in the document tree [CSS2].

The selectors, pseudo-elements, pseudo-classes, and at-rules that a printer MUST support are, with a few exceptions, the same as those that a moble device MUST support ([CSSMOBILE], Selectors ) within the limits of the printed page. The rationale for these decisions is that the capabilities and limitations of a mobile devices are analogous to those of a low-cost printer. However, support for the following constructs exceeds that of mobile devices, since this profile is concerned with printing: portions of the @page at-rule, the page pseudo-selector :first, and top and bottom margin boxes.

Consideration is also given to low-cost printerPP-UAs that might not be able to store all the attributes of each element, but only keep the few that are necessary. Therefore, only Enhanced Layout Extension conforming printerPP-UAs MUST support attribute selectors.

The following table summarizes CSS Print Profile selector syntax. In addition to the selectors marked "MUSTYes" in the CSS Print or CSS Print-Enhanced columns, the CSS Print Profile includes the CSS2 grouping mechanism (See [CSS2] Section 5.2.1).

Pattern Meaning Selector type CSS Print,
CSS Print-Enhanced
CSS Print-Enhanced
* Matches any element Universal selector MUSTYes, Yes MUST
E Matches any E element (i.e., any element of type E) Type selectors MUSTYes, Yes MUST
E F Matches any F element that is a descendant of an E element Descendant selectors MUSTYes, Yes MUST
E > F Matches any F element that is a child of an element E Child selectors MUSTYes, Yes MUST
E:first-child Matches element E when it is the first child of its parent The :first-child pseudo-class MAYNo MAYNo
E:link
E:visited
Matches element E if E is the source anchor of a hyperlink of which the target is not yet visited (:link) or already visited (:visited). The link pseudo-classes N/ANo N/ANo
E:active Matches E during certain user actions. The dynamic pseudo-classes N/ANo N/ANo
E:hover Matches E during certain user actions. The dynamic pseudo-classes N/ANo N/ANo
E:focus Matches E during certain user actions. The dynamic pseudo-classes N/ANo N/ANo
E:lang(c) Matches element of type E if it is in (human) language c (the document language specifies how language is determined). The :lang() pseudo-classes MAYNo MAYNo
E + F Matches any F element immediately preceded by an element E. Adjacent selectors MAYNo MAYNo
E[foo] Matches any E element with the "foo" attribute set (whatever the value). Attribute selectors MAYNo, Yes MUST
E[foo="warning"] Matches any E element whose "foo" attribute value is exactly equal to "warning". Attribute selectors MAYNo, Yes MUST
E[foo~="warning"] Matches any E element whose "foo" attribute value is a list of space-separated values, one of which is exactly equal to "warning". Attribute selectors MAYNo, Yes MUST
E[lang|="en"] Matches any E element whose "lang" attribute value has a hyphen-separated list of values beginning (from the left) with "en". Attribute selectors MAYNo MAYNo
E:first-line Matches the first formatted line of an E element. The :first-line pseudo-element MAYNo MAYNo
E:first-letter Matches the first formatted letter of an E element. The :first-letter pseudo-element MAYNo MAYNo
E:before Matches/creates generated content before an E element. The :before pseudo-element MAYNo MAYNo
E:after Matches/creates generated content after an E element. The :after pseudo-element MAYNo MAYNo
E.classid The same as E[class~=classid] Class selectors MUSTYes, Yes MUST
E#myid Matches any E element id equal to "myid". ID selectors MUSTYes, Yes MUST
@page :first Specifies style for the first page of a document Page pseudo-classes MUSTYes, Yes MUST
@page :left Specifies style for the left pages of a document Page pseudo-classes MAYNo MAYNo
@page :right Specifies style for the right pages of a document Page pseudo-classes MAYNo MAYNo

Table Notes:

† if the printerPP-UA supports the xml:lang attribute for the selection and control of language specific processing, then this selector MUST be supported.

3.1 at-rules

The CSS3 module: Paged Media [PAGEMEDIA] deprecates the top and bottom margin boxes defined by the @top and @bottom at-rules. These boxes are replaced by a series of boxes ranging across the top and bottom of the page that allow finer control and placement of content in running headers and footers. These margin boxes MUST be supported by a printer and, for compatibility with existing documents, the printer SHOULD also support the deprecated margin boxes. However, the printer MUST implemented the behavior described in CSS3 module: Paged Media ([PAGEMEDIA], Page Selector and page context) where the use of an non-deprecated margin box eclipses the deprecated margin box.

The following table summarizes CSS Print Profile at-rule syntax.

at-rule Function CSS Print CSS Print-Enhanced
@import Imports an external style sheet. MAYNo MUSTYes
@charset Defines character set for the style sheet. MUSTYes MUSTYes
@media Groups a set of style rules to apply only to one or more particular media. MUSTYes MUSTYes
@font-face Defines a named font-family, including for downloading. MAYNo MAYNo
@page Defines a (optionally named) page formatting context. MUSTYes MUSTYes
@color-profile Defines a named color-profile. MAYNo MAYNo
@bottom Defines an area on the page for a running footer [PAGEMEDIA] (deprecated) SHOULDYes SHOULDYes
@bottom-left-corner, @bottom-left,
@bottom-center, @bottom-right, @bottom-right-corner
Defines areas on the page within the running footer in the page's bottom margin [PAGEMEDIA] MUST MUST
@left Defines margin box in the page's left margin [PAGEMEDIA]. MAYNo MAYNo
@right Defines margin box in the page's right margin [PAGEMEDIA]. MAYNo MAYNo
@top Defines an area on the page for a running header [PAGEMEDIA] (deprecated) SHOULDYes SHOULDYes
@top-left-corner, @top-left,
@top-center,
@top-right,
@top-right-corner
Defines areas on the page within the running header in the page's top margin [PAGEMEDIA] MUST MUST

4. Properties

As with selectors, the properties a printer MUST support are the same as those that a mobile device MUST support ([CSSMOBILE], Properties) with the exception of those that don't apply to the page or are specifically targeted at media other than the page.

In some cases the allowable values for a printer are a subset of the full range of values to match the reduced memory and performance capabilities of a low-cost printer.

The following table summarizes CSS Print Profile properties and property values. Refer to [CSS2] for the definition of these properties and values.

Name CSS Print CSS Print-Enhanced CSS Values Initial value
'azimuth' N/ANo N/ANo <angle> | [[ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] || behind ] | leftwards | rightwards | inherit center
'background' background-color | inherit ['background-color' || 'background-image' || 'background-repeat' || 'background-position'] | inherit ['background-color' || 'background-image' || 'background-repeat' || 'background-attachment' || 'background-position'] | inherit see individual properties
'background-attachment' MAYNo MAYNo scroll | fixed | inherit scroll
'background-color' MUSTYes MUSTYes <color> | transparent | inherit transparent
'background-image' MAYNo MUSTYes <uri> | none | inherit none
'background-position' MAYNo MUSTYes [ [ <percentage> | <length> ]{1,2} | [ [top | center | bottom] || [left | center | right] ] ] | inherit 0% 0%
'background-repeat' MAYNo MUSTYes repeat | repeat-x | repeat-y | no-repeat | inherit repeat
'border' MAYNo MUSTYes [ <border-width> || <border-style> || [<color> | transparent] ] | inherit see individual properties
'border-collapse' MAYNo MUSTYes collapse | separate | inherit collapse
'border-color' MAYNo MUSTYes [<color> | transparent]{1,4} | inherit see individual properties
'border-spacing' MAYNo MUSTYes <length> <length>? | inherit 0
'border-style' MAYNo none, solid <border-style>{1,4} | inherit see individual properties
'border-top' 'border-right' 'border-bottom' 'border-left' MAYNo MUSTYes [ <border-width> || <border-style> || [<color> | transparent] ] | inherit see individual properties
'border-top-color' 'border-right-color' 'border-bottom-color' 'border-left-color' MAYNo MUSTYes <border-color> | transparent | inherit the value of the 'color' property
'border-top-style' 'border-right-style' 'border-bottom-style' 'border-left-style' MAYNo MUSTYes <border-style> | inherit none
'border-top-width' 'border-right-width' 'border-bottom-width' 'border-left-width' MAYNo MUSTYes <border-width> | inherit medium
'border-width' MAYNo MUSTYes <border-width>{1,4} | inherit see individual properties
'bottom' MAYNo MUSTYes <length> | <percentage> | auto | inherit auto
'caption-side' MAYNo MUSTYes top | bottom | left | right | inherit top
'clear' MAYNo MUSTYes none | left | right | both | inherit none
'clip' MAYNo MUSTYes <shape> | auto | inherit auto
'color' MUSTYes MUSTYes <color> | inherit depends on user agent
'content' inherit | [<string> | counter(pages)]+ inherit | [<string> | counter(pages)]+ [ <string> | <uri> | <counter> | attr(X) | open-quote | close-quote | no-open-quote | no-close-quote ]+ | inherit empty string
'counter-increment' "pages" "pages" [ <identifier> <integer> ]+ | none | inherit none
'counter-reset' MUSTYes MUSTYes [ <identifier> <integer>? ]+ | none | inherit none
'cue' N/ANo N/ANo [ 'cue-before' || 'cue-after' ] | inherit see individual properties
'cue-after' N/ANo N/ANo <uri> | none | inherit none
'cue-before' N/ANo N/ANo <uri> | none | inherit none
'cursor' N/ANo N/ANo [ [<uri> ,]* [ auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize| text | wait | help ] ] | inherit auto
'direction' MAYNo MAYNo ltr | rtl | inherit ltr
'display' MAYNo inline | block | list-item | none |inherit inline | block | list-item | run-in | compact | marker | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | none | inherit inline
'elevation' N/ANo N/ANo <angle> | below | level | above | higher | lower | inherit level
'empty-cells' MAYNo MAYNo show | hide | inherit show
'float' MAYNo MUSTYes left | right | none | inherit none
'font' [ [ 'font-style' || 'font-weight' ]? 'font-size' [ / 'line-height' ]? 'font-family' ] | inherit [ [ 'font-style' || 'font-weight' ]? 'font-size' [ / 'line-height' ]? 'font-family' ] | inherit [ [ 'font-style' || 'font-variant' || 'font-weight' ]? 'font-size' [ / 'line-height' ]? 'font-family' ] | caption | icon | menu | message-box | small-caption | status-bar | inherit see individual properties
'font-family' MUSTYes* MUSTYes* [[ <family-name> | <generic-family> ],]* [ <family-name> | <generic-family> ] | inherit depends on user agent
'font-size' MUSTYes ** MUSTYes ** <absolute-size> | <relative-size> | <length> | <percentage> | inherit medium
'font-size-adjust' MAYNo MAYNo <number> | none | inherit none
'font-stretch' MAYNo MAYNo normal | wider | narrower | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | inherit normal
'font-style' MUSTYes ** MUSTYes ** normal | italic | oblique | inherit normal
'font-variant' MAYNo MUSTYes normal | small-caps | inherit normal
'font-weight' MUSTYes ** MUSTYes ** normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit normal
'height' MUSTYes MUSTYes <length> | <percentage> | auto | inherit auto
'left' MAYNo MUSTYes <length> | <percentage> | auto | inherit auto
'letter-spacing' MAYNo MUSTYes normal | <length> | inherit normal
'line-height' MUSTYes MUSTYes normal | <number> | <length> | <percentage> | inherit normal
'list-style' MAYNo MUSTYes [ 'list-style-type' || 'list-style-position' || 'list-style-image' ] | inherit see individual properties
'list-style-image' MAYNo MUSTYes <uri> | none | inherit none
'list-style-position' MUSTYes MUSTYes inside | outside | inherit outside
'list-style-type' disc, decimal, lower-alpha, upper-alpha, none and inherit disc, decimal, lower-alpha, upper-alpha, none and inherit disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-alpha | lower-latin | upper-alpha | upper-latin | hebrew | armenian | georgian | cjk-ideographic | hiragana | katakana | hiragana-iroha | katakana-iroha | none | inherit disc
'margin' MUSTYes MUSTYes <margin-width>{1,4} | inherit see individual properties
'margin-top' 'margin-right' 'margin-bottom' 'margin-left' MUSTYes MUSTYes <margin-width> | inherit 0
'marker-offset' MAYNo MAYNo <length> | auto | inherit auto
'marks' MAYNo MAYNo [ crop || cross ] | none | inherit none
'max-height' MAYNo MAYNo <length> | <percentage> | none | inherit none
'max-width' MAYNo MAYNo <length> | <percentage> | none | inherit none
'min-height' MAYNo MAYNo <length> | <percentage> | inherit 0
'min-width' MAYNo MAYNo <length> | <percentage> | inherit depends on user agent
'orphans' MAYNo MUSTNo <integer> | inherit 2
'outline' N/ANo N/ANo [ 'outline-color' || 'outline-style' || 'outline-width' ] | inherit see individual properties
'outline-color' N/ANo N/ANo <color> | invert | inherit invert
'outline-style' N/ANo N/ANo <border-style> | inherit none
'outline-width' N/ANo N/ANo <border-width> | inherit medium
'overflow' MAYNo MUSTYes visible | hidden | scroll | auto | inherit visible
'padding' MAYNo MUSTYes <padding-width>{1,4} | inherit see individual properties
'padding-top' 'padding-right' 'padding-bottom' 'padding-left' MAYNo MUSTYes <padding-width> | inherit 0
'page' MUSTYes MUSTYes <identifier> | auto auto
'page-break-after' auto | always | inherit auto | always | inherit auto | always | avoid | left | right | inherit auto
'page-break-before' auto | always | inherit auto | always | inherit auto | always | avoid | left | right | inherit auto
'page-break-inside' MUSTYes MUSTYes avoid | auto | inherit auto
'pause' N/ANo N/ANo [ [<time> | <percentage>]{1,2} ] | inherit depends on user agent
'pause-after' N/ANo N/ANo <time> | <percentage> | inherit depends on user agent
'pause-before' N/ANo N/ANo <time> | <percentage> | inherit depends on user agent
'pitch' N/ANo N/ANo <frequency> | x-low | low | medium | high | x-high | inherit medium
'pitch-range' N/ANo N/ANo <number> | inherit 50
'play-during' N/ANo N/ANo <uri> mix? repeat? | auto | none | inherit auto
'position' N/ANo MUSTYes static | relative | absolute | fixed | inherit static
'quotes' MAYNo MAYNo [ <string><string>]+ | none | inherit depends on user agent
'richness' N/ANo N/ANo <number> | inherit 50
'right' MAYNo MUSTYes <length> | <percentage> | auto | inherit auto
'size' <length>{1,2} | auto | portrait | inherit <length>{1,2} | auto | portrait | landscape2 | inherit <length>{1,2} | auto | portrait | landscape | inherit auto
'speak' N/ANo N/ANo normal | none | spell-out | inherit normal
'speak-header' N/ANo N/ANo once | always | inherit once
'speak-numeral' N/ANo N/ANo digits | continuous | inherit continuous
'speak-punctuation' N/ANo N/ANo code | none | inherit none
'speech-rate' N/ANo N/ANo <number> | x-slow | slow | medium | fast | x-fast | faster | slower | inherit medium
'stress' N/ANo N/ANo <number> | inherit 50
'table-layout' MAYNo MUSTYes auto | fixed | inherit auto
'text-align' left | center | inherit left | right | center | inherit left | right | center | justify | <string> | inherit depends on user agent and writing direction
'text-decoration' none, underline, and inherit none, underline, and inherit none | [ underline || overline || line-through || blink ] | inherit none
'text-indent' MUSTYes MUSTYes <length> | <percentage> | inherit 0
'text-shadow' N/ANo N/ANo none | [<color> || <length> <length> <length>? ,]* [ <color> || <length> <length> <length>?] | inherit none
'text-transform' MAYNo MUSTYes capitalize | uppercase | lowercase | none | inherit none
'top' MAYNo MUSTYes <length> | <percentage> | auto | inherit auto
'unicode-bidi' MAYNo MAYNo normal | embed | bidi-override | inherit normal
'vertical-align' MAYNo MUSTYes1 baseline | sub | super | top | text-top | middle | bottom | text-bottom | <percentage> | <length> | inherit baseline
'visibility' MAYNo MUSTYes visible | hidden | collapse | inherit inherit
'voice-family' N/ANo N/ANo [[ <specific-voice> | <generic-voice> ],]* [ <specific-voice> | <generic-voice> ] | inherit depends on user agent
'volume' N/ANo N/ANo <number> | <percentage> | silent | x-soft | soft | medium | loud | x-loud | inherit medium
'white-space' MUSTYes MUSTYes normal | pre | nowrap | inherit normal
'widows' MAYNo MUSTNo <integer> | inherit 2
'width' MUSTYes MUSTYes <length> | <percentage> | auto | inherit auto
'word-spacing' N/ANo N/ANo normal | <length> | inherit normal
'z-index' MAYNo MAYNo auto | <integer> | inherit auto

Table Note:

† Only the single identifier "pages" that represents the current page number is REQUIRED.

* It is RECOMMENDED that a printerPP-UA minimally support "serif," "sans-serif," and "monospace" font families.

** The supported values SHOULD be appropriate to the fonts available to the printerPP-UA.

‡ The printerPP-UA MAY ignore positioned elements that are placed on the page before the position of the current element in the normal flow.

1 Vertical alignment is undefined across page boundaries.

2 The printerPP-UA MAY ignore the value landscape if it lacks the memory to support landscape printing.

5. CSS Syntax

The CSS Print Profile uses the same syntax as specified in Cascading Style Sheets, Level 2 (CSS2) [CSS2]. The CSS Print Profile uses a subset of the values used in CSS2. Specifically:

  1. The printerPP-UA SHALL support integer and real numbers ([CSS2] Section 4.3.1).
  2. The printerPP-UA SHALL support the following lengths ([CSS2] Section 4.3.2):
    • px
    • em
    • ex
    • in
    • cm
    • mm
    • pt
    • pc
    The printerPP-UA MAY support other lengths.
  3. The printerPP-UA SHALL support percentage values ([CSS2] Section 4.3.3).
  4. The printerPP-UA SHALL support URI values ([CSS2] Section 4.3.4).
  5. The printerPP-UA SHALL support the "pages" counter value that tracks page numbers ([CSS2] Section 4.3.5).
  6. The printerPP-UA SHALL support the following color values ([CSS2] Section 4.3.6):
    • The 16 colors defined in HTML 4.01 [HTML4]
    • A numerical RGB specification ([CSS2] Section 4.3.6)
    The printerPP-UA MAY support other color values. The printerPP-UA is not REQUIRED to support user preferences for colors ([CSS2] Section 18.2).
  7. The printerPP-UA is not REQUIRED to support user preferences for fonts ([CSS2] Section 18.3).

Similarly, the CSS Print Profile requires that conforming user agents support the character encoding mechanisms specified in CSS2 [CSS2]. Specifically:

  1. The printerPP-UA SHALL support priorities specified in CSS2 [CSS2] to determine a document's character encoding.
  2. The printerPP-UA SHALL support the CSS2 @charset rules. However, if the character set specified by the @charset rule of a external style sheet is not supported by the printerPP-UA, the style sheet will be ignored.

6. Assigning Property Values, Cascading, and Inheritance

In general, the CSS Print Profile uses the same cascading rules as in CSS2. Specifically:

  1. The printerPP-UA SHALL assign values as described in CSS2 ([CSS2] Section 6.1).
  2. The printerPP-UA SHALL support inheritance as described in CSS2 ([CSS2] Section 6.2).
  3. A printerPP-UA supporting Enhanced Layout Extension conformance SHALL support the CSS2 @import rules as specified in CSS2 ([CSS2] Section 6.3).
  4. The printerPP-UA SHALL support author originating style sheets. The printerPP-UA MAY support user or user-agent originating style sheets ([CSS2] Section 6.4).
  5. The printerPP-UA SHALL support all CSS2 cascading mechanisms ([CSS2] Sections 6.4.1-6.4.4).

7. Media Types

A CSS Print Profile conforming user agent SHALL be able to process media-dependent style sheets as specified in CSS2 ([CSS2] Section 7). Specifically:

  1. The printerPP-UA SHALL support the CSS2 @media rules as specified in CSS2 ([CSS2] Section 7).
  2. The printerPP-UA SHALL accept and process style sheets that target the print media type.
  3. The printerPP-UA SHALL accept and process style sheets that target the all media type.
  4. The printerPP-UA SHALL accept style sheets that contain other (non-print) media-dependent style sheets.
  5. The printerPP-UA MAY process other media types (such as projection or handheld).

The printerPP-UA is not REQUIRED to satisfy unreferenced CSS2 conformance statements pertaining to the print media type (see [CSS2] Section 7.3.1); the printerPP-UA SHALL satisfy the conformance statements and references in this specification.

8. CSS Print Profile Properties and User Agent interactions

The following sections relax or otherwise modify the conformance requirements.

8.1 Nested Floats, Divs, and Absolutely Positioned Boxes

The nesting of floats, divs, and absolutely positioned boxes within themselves, each other, and table cells is discouraged since the nesting depth of these constructs is printer and implementation dependent. Therefore, a printer is not REQUIRED to supported nesting of these constructs beyond an implementation dependent limit.

8.21 Page Breaks

If page-break-inside: avoid is specified for a long element and the printerPP-UA is unable to buffer the entire element before committing it to paper, it SHOULD force a page break to occur before the long element and begin the element starting at the top of the next page. If the long element starts at the top of a page and exceeds the page length, the printerPP-UA SHALL print as much as possible on the first page and then resume that element on the next and subsequent pages as REQUIRED to preserve the content. A printerPP-UA is neither REQUIRED nor forbidden to perform scaling to fit the long element on a single page.

8.32 Page Size and Orientation

The pPage size and orientation values specified bythat is provided using the CSS Print Profile Properties MUSTwill override similar attributes contained within any commands and/or attributes provided by job-submission protocols.

Due to a printerPP-UA's mechanical limitations, the actual printable area of the page is usually less than the page size. Results are printerPP-UA-dependent when the page size specified by the CSS size propertyspecified does not match the media size the printer chooses to print onbeing used. However, a printer SHOULD be guided by the page size value supplied by the CSS size property when choosing the media to print on.

8.32.1 Rendering Page Boxes that do not fit a Target Sheet

If a page box does not fit the target sheet dimensions, that is, the actual dimensions of the media the printer will be using, the printerPP-UA MAY choose (in order of preference) to:

The printerPP-UA MAY consult the user before performing these operations. Lacking "access" to the user, it MAY simply make a decision on its own.

8.32.2 Positioning the Page Box on the Sheet

When the page box is smaller than the dimensions of the media the printer is usingtarget size, the printerPP-UA MAYis free to place the page box anywhere on the sheet. However, it is RECOMMENDED that the page box be centered on the sheet since this will align double-sided pages and avoid accidental loss of information that is printed near the edge of the sheet

8.43 Running Headers and Footers

Page headers and footers are useful in printed documents. CSS3 module: Paged Media [PAGEMEDIA] provides a mechanism for placing content into the top and bottom page margins thereby creating running headers and footers. The top and bottom margin areas are subdivided into a series of margin boxes that provide control over content placement within the headers and footers: Current work in progress by the W3C on paged media defines a method for adding margin boxes to the top, bottom, left and right of the page. (See [PAGEMEDIA].) A reduced set from the CSS3 proposal is employed by the CSS Print Profile, using top and bottom margin boxes to implement running-headers and a running-footers via the @page rules method.

  • top-left-corner and bottom-left-corner margin boxes placed at the intersection of the left margin with the top and bottom margins (respectively).
  • top-right-corner and bottom-right-corner margin boxes placed at the intersection of the right margin with the top and bottom margins (respectively).
  • top-left, top-center, and top-right margin boxes in the area between the top-left-corner and the top-right-corner margin boxes.
  • bottom-left, bottom-center, and bottom-right margin boxes in the area between the bottom-left-corner and the bottom-right-corner margin boxes.

A printer MAY vertically align the content of the top margin boxes with the top of the box and the content of the bottom margin boxes with the bottom of the bottom margin boxes.

The top-center margin box MUST be centered on the page, however, the relative widths of the top-left, top-center, and top-right are implementation dependent. The same holds true for the bottom-left, bottom-center, and bottom-right margin boxes.

Utilizing the terminology of CSS2 and CSS3, a "margin box" is defined in conjunction with the "page box" and "page area" as shown in Figure 3: Page Areas to create an area into which running-header and running-footer text can be inserted.

CSS3 proposes the ability to left-align, right-align and center the text horizontally as well as methods to top-align, bottom-align and center the text vertically within the margin boxes. However, conforming printerPP-UA implementations SHOULD NOT support vertical alignment within top and bottom margin boxes. Instead, conforming printerPP-UA implementations, SHALL top align the running-header text in the margin box and the running-footer text SHALL be bottom aligned in the margin box.

CSS3 proposes methods for the printing device to automatically include:

  • page number
  • total pages in the document
  • date
  • time
  • file name

into the running-header and running-footer. However, conforming printerPP-UA implementations are only REQUIRED to support inserting a page number. Therefore, the sending appliance SHALL provide the other information within the text string to be printed in the margin box.

 

Page Area

Figure 3: Page Areas

The following are sample XHTML/CSS fragments used to create running-headers and running-footers.

<style> 
 @page { 
   @top-left{
       font-family: Helvetica, Arial, sans-serif; 
       font-size: 18pt150%; 
       font-weight: bolder; 
       text-align: left; 
       content: "XHTML-Print: A Proposal --- August 25, 2000"; 
   } 
 } 
</style>

The above example creates a running header that is left aligned at 150% of normal font size, with respect to the body's font, and bold in Helvetica, Arial or the default sans-serif eighteen point font whichever is available.

A printer MUST support a page counter, 'pages', that SHOULD be used to reference a page's page number. The counter MUST be incremented by the counter-increment property and reset to zero by the counter-reset property. Therefore, if the counter reset property is placed in any of the top margin boxes, the counter's value MUST be incremented at the top of the page, while if the property is placed in any of the bottom boxes it is incremented at the end of the page. If the counter-increment property is placed in the page context the counter MUST be incremented at the top of the page.

<style>
 @page {
  counter-increment: pages;
  @bottom-center {
      font-family: Times, Palatino, serif; 
      font-size: 12pt80%;
      font-weight: normal;
      text-align: center;
      content: "Page " counter(pages);
  }
 }
</style>

The above example creates a running footer such as "Page 14" centered on the page in a font 80% of normal size in Times, Palatino or the default serif twelve point font whichever is available. Note that since the counter named "pages" is both incremented and used by the @page rule, it will first be incremented and then used; so the footer on the first page will be "Page 1".

8.54 Default Style Sheets

This section is informative.

Appendix A of Cascading Style Sheets, Level 2 ([CSS2], Appendix A) provides a sample style sheet in its Appendix A. This sheet uses several properties that are not REQUIRED of a conforming printerPP-UA, even ones supporting the enhanced layout extensions (section 2.1).

8.54.1 Default Style Sheet Guidelines for printers

Developers of printerPP-UAs that do not implement the enhanced layout facilities are encouraged but not REQUIRED to adhere to the following implementation guidelines that address unsupported properties. These guidelines are presented to promote consistency between printerPP-UA implementations.

The guidelines below are annotated to show derivation of the guideline from the Cascading Style Sheets, Level 2 [CSS2] style sheet.

  1. The address, blockquote, body, dd, div, dl, dt, h1, h2, h3, h4, h5, h6, hr, object, ol, p, pre, and ul elements should be treated as if their display property were set to block.
  2. The li element should be treated as if its display property were set to list-items.
  3. The table elements, table, tr, td, th, and caption, should have their standard meaning and display treatments: table, table-row, table-cell, and table-caption.
  4. The elements base, br, html, head, link, meta, param, style and title should be treated as if their display property were set to none.
  5. The remaining elements, a, abbr, acronym, b, big, cite, code, dfn, em, form, i, img, input, kbd, option, samp, small, select, strong, sub, sup, textarea, tt, and var, should be treated as if their display property were set to inline. A display property of inline for the elements img, input, select, and textarea allows document authors a flexibility not available if their display property were block.
    The above guidelines come from the following portion of the CSS2 default style sheet:
    
    ADDRESS, BLOCKQUOTE, BODY, DD, DIV, DL, DT, FIELDSET, FORM, 
    FRAME, FRAMESET, H1, H2, H3, H4, H5, H6, IFRAME, NOFRAMES, 
    OBJECT, OL, P, UL, APPLET, CENTER, DIR, HR, MENU, 
                  { display: block }
    LI            { display: list-item }
    HEAD          { display: none }
    TABLE         { display: table }
    TR            { display: table-row }
    THEAD         { display: table-header-group }
    TBODY         { display: table-row-group }
    TFOOT         { display: table-footer-group }
    COL           { display: table-column }
    COLGROUP      { display: table-column-group }
    TD, TH        { display: table-cell }
    CAPTION       { display: table-caption } 
    
  6. The edges of the content of body element should have 0.1 inch wide inset from the left, top, right, and bottom of the printable area of the page. Margin calculations will start from these offsets.
    The .1 inch figure comes from the calculation that 8 px divided by 75px/inch ( a normal display resolution) is about .1 inches.
    
    BODY          { padding: 8px; 
                    line-height: 1.33 } 
    
  7. The content of the sub element should be treated as if its vertical-align property were set to sub. Similarly, the content of the sup element should be treated as if its vertical-align property were set to sup.
    
    SUB             { vertical-align: sub }
    SUP             { vertical-align: super } 
    
  8. The hr element should be treated as if its area, as defined by its height and width, were outlined by a one pixel thickwide, solid line. The default line should be one pixel high and the width of the containing box.
    
    HR              { border: 1px inset } 
    
  9. The lower case letters of the content of the abbr and acronym elements should be rendered as scaled capital letters, at approximately 75% of their size at the current font size. Upper case letters will be unchanged. PrintersPP-UA MAY also choose to simply render lower case letters as upper case letters without scaling.
    The 75% figure above is only one way to approximate small-caps. The printerPP-UA is free to use its own rendering of small-caps.
    
    ABBR, ACRONYM   { font-variant: small-caps; 
                      letter-spacing: 0.1em } 
    
  10. Page break avoidance both inside and after is removed for the elements h1, h2, h3, h4, h5, and h6. Therefore, the printer is not REQUIRED to move PP-UA need not be concerned with moving the content of these elements from the bottom of one page to the top of the next.
    
    H1, H2, H3,
    H4, H5, H6    { page-break-after: avoid; 
                    page-break-inside: avoid }
    
  11. The printerPP-UA need not avoid page breaks before the ul, ol, and dl elements.
    
    UL, OL, DL    { page-break-before: avoid } 
    
  12. The printerPP-UA MAY choose its own, fixed value for the padding properties of elements where the Cascading Style Sheets, Level 2[CSS2] box model ([CSS2], section 8) applies.
  13. The content of all elements, except hr, should be treated as if the element's border-style property were set to none.
  14. The content of all elements MAY be treated as if the element's overflow property were set to visible and the clip property set to auto.
    This guideline suggests consistent behavior among implementations.
  15. The content of all elements may be treated as if the element's positioning property were set to static.
    Elements should be treated as if they are in the normal flow.
  16. Tables should be treated as if the table-layout property were set to fixed.
    This guideline promotes consistency since
    • the table-layout property is not mandated
    • There isn't a CSS default style sheet rule for this property

The following style sheet is a modification of the sample sheet in Appendix A of Cascading Style Sheets, Level 2 ([CSS2], Appendix A) and depends on the above guidelines.

th              { font-weight: bolder; text-align: center }
caption         { text-align: center }
body            { line-height: 1.33 }
h1              { font-size: 2em; margin: .67em 0 }
h2              { font-size: 1.5em; margin: .83em 0 }
h3              { font-size: 1.17em; margin: 1em 0 }
h4, p,
blockquote, ul,
form,
ol, dl          { margin: 1.33em 0 }
h5              { font-size: .83em; line-height: 1.17em; margin: 1.67em 0 }
h6              { font-size: .67em; margin: 2.33em 0 }
h1, h2, h3, h4,
h5, h6, b,
strong          { font-weight: bolder }
blockquote      { margin-left: 40px; margin-right: 40px }
i, cite, em,
var, address    { font-style: italic }
pre, tt, code,
kbd, samp       { font-family: monospace }
pre             { white-space: pre }
big             { font-size: 1.17em }
small, sub, sup { font-size: .83em }
ol, ul, dd      { margin-left: 40px }
ol              { list-style-type: decimal }
ol ul, ul ol,
ul ul, ol ol    { margin-top: 0; margin-bottom: 0 }
br       { content: "\A" }

@media print {
  @page         { margin: 10% }
  blockquote, 
  pre           { page-break-inside: avoid }
}

8.54.2 Default Style Sheet Guidelines for Enhanced Layout printers

Developers of printerPP-UAs conforming to the enhanced layout extensions (section 2.1) MUST implement more of Cascading Sytle Sheets, Level 2 [CSS2] than conforming printerPP-UAs, although the set of properties and their values is still less than completethose defined in [CSS2].

Developers of printerPP-UAs are encouraged but not REQUIRED to adhere to the following implementation guidelines that address unsupported properties.

  1. The table elements, table, tr, td, th, and caption, should have their standard meaning and display treatments: table, table-row, table-cell, and table-caption.
  2. The rendering of the hr element is implementation dependent.
  3. The content of the sub element should be treated as if its vertical-align property were set to sub. Similarly, the content of the sup element should be treated as it its vertical-align property were set to sup.
  4. The lower case letters of the content of the abbr and acronym elements should be rendered as scaled capital letters, at approximately 75% of their size at the current font size. Upper case letters will be unchanged. printerPP-UA may also choose to simply render lower case letters as upper case letters without scaling.
  5. Page break avoidance both inside and after is removed for the elements h1, h2, h3, h4, h5, and h6. Therefore, the printerPP-UA need not be concerned with moving the content of these elements from the bottom of one page to the top of the next.
  6. The printerPP-UA need not avoid page breaks before the ul, ol, and dl elements.

The following style sheet is a modification of the sample sheet in Appendix A of [CSS2] and depends on the above guidelines.

address,
blockquote, 
body, dd, div, 
dl, dt, 
form,
h1, h2, h3, h4, 
h5, h6, 
object, ol, p, 
ul,
hr, pr e        { display: block }
li              { display: list-item }
head            { display: none }
th              { font-weight: bolder; text-align: center }
caption         { text-align: center }
body            { padding: 8px; line-height: 1.33 }
h1              { font-size: 2em; margin: .67em 0 }
h2              { font-size: 1.5em; margin: .83em 0 }
h3              { font-size: 1.17em; margin: 1em 0 }
h4, p,
blockquote, ul,
form,
ol, dl,         { margin: 1.33em 0 }
h5              { font-size: .83em; line-height: 1.17em; margin: 1.67em 0 }
h6              { font-size: .67em; margin: 2.33em 0 }
h1, h2, h3, h4,
h5, h6, b,
strong          { font-weight: bolder }
blockquote      { margin-left: 40px; margin-right: 40px }
i, cite, em,
var, address    { font-style: italic }
pre, tt, code,
kbd, samp       { font-family: monospace }
pre             { white-space: pre }
big             { font-size: 1.17em }
small, sub, sup { font-size: .83em }
hr              { border: 1px  }
ol, ul, dd      { margin-left: 40px }
ol              { list-style-type: decimal }
ol ul, ul ol,
ul ul, ol ol    { margin-top: 0; margin-bottom: 0 }
br       { content: "\A" }

@media print {
  @page         { margin: 10% }
  blockquote, 
  pre           { page-break-inside: avoid }
}

9. Acknowledgements

This section is informative.

This specification is based, almost exclusively, on the specification of the same name, CSS Print Profile [CSSPP] from the Printer Working Group, a program of and through the IEEE Industry Standards and Technology Organization, Inc., and the editor wishes to express his gratitude to all those who contributed to it.

Appendix A. References

A.1 Normative References

[CSS1]
Cascading Style Sheets, Level 1, H.W. Lie and B. Bos, World Wide Web Consortium, 17 December 1996, revised 11 Jan 1999. This version of the Cascading Style Sheets, Level 1 recommendation is http://www.w3.org/TR/1999/REC-CSS1-19990111. The latest version of CSS1 is available at http://www.w3.org/TR/REC-CSS1.
[CSS2]
Cascading Style Sheets, Level 2, B. Bos, et al., World Wide Web Consortium, 12 May 1998. This version of the Cascading Style Sheets, Level 2 recommendation is http://www.w3.org/TR/1998/REC-CSS2-19980512. The latest version is available at http://www.w3.org/TR/REC-CSS2.
[HTML4]
HTML 4.01 Specification, D. Raggett, A. Le Hors, and I. Jacobs, Editors. World Wide Web Consortium, 17 December 1997, revised 24 December 1999. This version of the HTML 4.01 Recommendation is http://www.w3.org/TR/1998/REC-html40-19980424. The latest version of HTML 4 is available at http://www.w3.org/TR/html4.
[PAGEMEDIA]
[updated to latest released CSS3 module: Paged Media] Paged Media Properties for CSS3 Robert Stevahn, 28 September, 1999. Available at http://www.w3.org/TR/1999/WD-css3-page-19990928.
[RFC2119]
RFC2119 - Key words for use in RFCs to Indicate Requirement Levels, S. Bradner, The Internet Engineering Task Force, March 1997. It is available from http://www.ietf.org/rfc/rfc2119.txt?number=2119
[XHTMLPRINT]
XHTML-Print, W3C Working Draft, Jim Bigelow, World Wide Web Consortium, 23 July 2003. This version of XHTML-Print is http://www.w3.org/MarkUp/Group/2003/WD-xhtml-print-20030723. The latest version of XHTML-Print is available at http://www.w3.org/MarkUp/Group/2003/WD-xhtml-print-20030723.

A.2 Informative References

[CSSPP]
CSS Print Profile, PWG Propose Standard 5102.2, D. Wright, J. Bigelow, eds. 28 March 2003. Available at: http://www.pwg.org/xhtml-print/HTML-Version/CSS-Print.html
[CSSMOBILE]
CSS Mobile Profile 1.0, W3C Candidate Recommendation 25 July 2002, T. Wugofski, D. Dominiak, R. Stark, T. Roy, at http://www.w3.org/TR/css-mobile.