HTML Landscape printing
htmlTo 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:
@page
: https://developer.mozilla.org/en-US/docs/Web/CSS/@pagesize
: https://developer.mozilla.org/en-US/docs/Web/CSS/size
Other Article on Tag html
- - convert HTML to XHTML
- - dynamically create html element in javascript
- - How to auto-size an iFrame
- - How to use google image url as src for image
- - .htm vs .html what is different?
- - HTML CSS insert line breaks in HTML documents
- - html css Remove border from IFrame
- - HTML Landscape printing
- - html layout
- - html textarea no change size