1. Computing & Technology

Discuss in my forum

size

By , About.com Guide

size Description:

The size property applies to paged media and defines the size of the pages either in absolute or relative terms. Absolute page boxes have a fixed size, while relative page boxes are scaled to fit the media they are applied to.

size in CSS Versions:

size Syntax:

size : <length> (<length>) | portrait | landscape | auto | inherit

  • <length> (<length>)
    A precise unit of measurement. If you specify one length value, the page will be drawn as a square. If you specify two values they will define the page width and then height. This creates an absolute page box.
  • portrait
    This defines the page box with the content flowing along the short side. This creates a relative page box.
  • landscape
    This defines the page box with the content flowing along the long side. This creates a relative page box.
  • auto
    This defines the page box with the size and orientation of the page as the user-agent would normally define it. This creates a relative page box.
  • inherit
    The element should have the same value as the parent element.

size Initial Value:

auto

size Applies to:

Paged media

size Inheritance:

This property is not inherited.

size Browser Support:

size Media Type:

Paged

size Examples:

Set a page to a specific size:

size : 8.5" 11"

Require the element be printed in landscape:

size : landscape;

size Special Notes:

Always be very careful to test your print style sheets. Not all browsers support CSS 3 properties, and with paged media styles, you can be surprised at how they print.

More Information on the size CSS Property

More help with CSS 3
Return to the Style Library

©2012 About.com. All rights reserved.

A part of The New York Times Company.