The size property specifies the target size and orientation of the page box's containing block. In the general case, where one page box is rendered onto one page sheet, the 'size' property also indicates the size of the destination page sheet.

  • Initial valueauto
  • Applies toPage content
  • InheritedN/A
  • MediaPaged
  • Computed valueSpecified value
  • AnimatableNo
  • CSS VersionCSS2, CSS3
  • JavaScript syntaxobject.style.size
Formal syntax: <length>{1,2} | auto | [ <page-size> || [ portrait | landscape] ]

size: A4 landscape;
size: 9in 12in;    /* width height */
size: auto;
  • <length>The page box will be set to the given absolute dimension(s). If only one length value is specified, it sets both the width and height of the page box (i.e., the box is a square). If two length values are specified, the first establishes the page box width, and the second the page box height.
  • autoThe page box will be set to a size and orientation chosen by the browser.
  • lt;page-size>A page size can be specified using one of the following media names: A5, A4, A3, B5, B4, letter, legal and ledger
  • portraitSpecifies that the page's content be printed in portrait orientation.
  • landscapeSpecifies that the page's content be printed in landscape orientation.
.class {
   size: 25px 54px; 
}
10+FirefoxnoExplorer7+ChromenoSafari8+Opera


Last updated on 23rd March 2014 By Rene Spronk

View All CSS Properties

Errors? Please help to keep this list up to date, If you find any errors, please contact us, so that we can get them fixed.