The CSS rule
@page {size: landscape;}
is supposed to force browsers to print pages in landscape mode. This rule is mentioned in many questions on stackoverflow, on many other programming sites, and in reference works such as O'Reilly's HTML/XTHML The Definitive Guide, Fifth Edition.
I've tried to using this CSS rule with many different format tweaks with both inline styles and linked style sheets, specifying media and not specifying media, with IE8, Chrome 7.0, and Firefox 3.6. I've tried printing to a Xerox Phaser 8560 and to the Adobe PDF print driver. All of my testing has been done on Windows Vista Ultimate 64 bit.
I have never see this CSS rule actually work, i.e. I've never seen a page print landscape on any attempt. Admittedly I haven't done really thorough QA on this, since I've only tried 2 printer drivers and one OS.
Have you actually seen this rule work for a browser, OS, and printer configuration? There is some mention in other questions on this topic that the rule is not broadly supported. Since I can't get it to work on my development machine at all I am wondering when, if ever, does it work? It would help to get specifics on browser, OS, and printer combinations that are known to work, or to confirm that this is a waste of time.
ANSWER. Landscape printing is when the correct orientation of a printout appears with the longest edge in the horizontal direction. For example, the A4 printout thumbnails in diagram 1 (below) would be classed as landscape and portrait respectively.
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.
href = "landscape.
CSS 2.1 no longer specifies the size
attribute. The current working draft for CSS3 Paged Media module does specify it (but this is not standard or accepted). I have not been able to find a report of specific browser/version support, but I get the sense that it is poorly supported (perhaps only by Opera?).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With