HTML Landscape printing

html

To print an HTML document in landscape orientation, you can use the @page rule and the size property in CSS. The @page rule allows you to specify styles for the page when it is printed, and the size property allows you to set the size and orientation of the page.

To print an HTML document in landscape orientation, you can use the following @page rule:

@page {
    size: landscape;
}

This will set the page to landscape orientation when the document is printed.

You can also specify the size of the page using the size property. For example, to set the page to a specific size in landscape orientation, you can use the following @page rule:

@page {
    size: 8.5in 11in;
}

This will set the page to 8.5 inches wide and 11 inches tall in landscape orientation when the document is printed.

Note that the @page rule is not supported by all browsers, and the behavior may vary depending on the browser and the printer being used. It is a good idea to test the document in different browsers and printers to ensure that the page is printed correctly.

For more information on the @page rule and the size property, you can refer to the CSS documentation: