style.size (Property)

Defines the size and orientation of a bounding box on a printed page.


CSS level - 2
DOM level - 2
Property/method value type:String primitive
JavaScript syntax:nonemyStyle.size
CSS syntax:size: anAspect size: aSize anAspect size: aWidth aHeight anAspect
Argument list:aSizeWhen only one length value is specified, the page is square
anAspectAn aspect ration control
aWidthA page width
aHeightA page height

This is part of the printing control mechanism in the CSS level 2 specification.

It provides a way to set the page size and aspect ration of the printed output. This should not affect the display of the page on the screen.

There are three parameter values expected. The first two are numeric values describing the page size. These are expressed in measurement units. You can optionally only include one because the third parameter is a keyword. If you omit both of the numeric values, the page size is assumed to be that of the printer by default. If only one is specified, then a square printable area is defined. Two values control the page width and page height respectively.

Printers may apply a non-printable margin area to the page, and the value you specify here must fit within it otherwise the content may be cropped when it is printed.

The last parameter value is specified using one of the following keywords:

See, style.orphans,, style.pageBreakAfter, style.widows