Role of size property in CSS to set the size and orientation of a page box


The size property specifies the size and orientation of a page box. There are four values which can be used for page size

  •  auto - The page box will be set to the size and orientation of the target sheet.
  • landscape − Overrides the target's orientation. The page box is the same size as the target, and the longer sides are horizontal.
  • portrait − Overrides the target's orientation. The page box is the same size as the target, and the shorter sides are horizontal.
  • length − Length values for the 'size' property create an absolute page box. If only one length value is specified, it sets both the width and height of the page box. Percentage values are not allowed for the 'size' property.

Updated on: 16-Mar-2020

81 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements