This question has been asked, and answered, but the heavily upvoted accepted answer both:
- doesn't explain how to do it
- does not work
The reason, of course, is that the accepted answer1 is deprecated2. And the W3C has not come up with any standard replacement. Which leaves me with a problem, as I have actual things that need to get done.
How to tell browsers to print content in landscape?
Example that doesn't work
I threw together an example that contains every snippet of chewing gum that i could find.
<!DOCTYPE html>
<HEAD>
<STYLE type="text/css">
/* https://mcmap.net/q/55113/-landscape-printing-from-html */
@page
{
size: landscape;
}
/* http://www.devx.com/tips/Tip/32962 */
@media print{
@page {
size: landscape
}
}
/* https://mcmap.net/q/1104213/-how-can-i-define-a-css-class-to-set-the-printed-page-in-landscape-mode */
@media print{
.class-name{
@page{
size:landscape;
}
}
}
</STYLE>
<!--https://mcmap.net/q/295008/-print-in-landscape-format-duplicate -->
<STYLE type="text/css" media="print">
@page { size: landscape; }
</STYLE>
</HEAD>
<BODY>
Hello, landscape.
</BODY>
</HTML>
Can anyone come up with something that does work?
Assume Chrome, IE11 or Edge.
Background
The reason i'm doing this, of course, is that i need to print landscape. In my particular case i will be using the rich markup and layout services available in HTML to print on an 8.5x11" piece of tri-perforated paper:
I want to go down the strips vertically, except that means having to have the text, images, and layout, be horizontal on the page: