This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The size
CSS at-rule descriptor, used with the @page
at-rule, defines the size and orientation of the box which is used to represent a page. Most of the time, this size corresponds to the target size of the printed page if applicable.
Size may either be defined with a "scalable" keyword (in this case the page will fill the available dimensions) or with absolute dimensions.
Value not found in DB!
/* Keyword values for scalable size */ size: auto; size: portrait; size: landscape; /* <length> values */ /* 1 value: height = width */ size: 6in; /* 2 values: width then height */ size: 4in 6in; /* Keyword values for absolute size */ size: A4; size: B5; size: JIS-B4; size: letter; /* Mixing size and orientation */ size: A4 portrait;
auto
landscape
portrait
<length>
<length>
). The first value corresponds to the width of the page box and the second one corresponds to its height. If only one value is provided, it is used for both width and height.<page-size>
@page { size: 4in 6in landscape; }
@media print { @page { size: 50mm 150mm; } }
Specification | Status | Comment |
---|---|---|
CSS Paged Media Module Level 3 The definition of 'size' in that specification. | Working Draft | Initial definition |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | ? | ? | ? | ? | ? | ? |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | ? | ? | ? | ? | ? | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/@page/size