CSS size Property

Description

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 value
auto
Applies to
Page content
Inherited
N/A
Media
Paged
Computed value
Specified value
Animatable
No
CSS Version
CSS2, CSS3
JavaScript syntax
object.style.size

Syntax

Formal syntax: <length>{1,2} | auto | [ <page-size> || [ portrait | landscape] ]

size: A4 landscape;
size: 9in 12in;    /* width height */
size: auto;

Values

  • <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.

Example

.class {
   size: 25px 54px; 
}

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
??????
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
??????