How to print in landscape with CSS?

Spread the love

Sometimes, we want to print in landscape with CSS.

In this article, we’ll look at how to print in landscape with CSS.

How to print in landscape with CSS?

To print in landscape with CSS, we use the size property.

For instance, we write

@media print {
  @page {
    size: landscape;
  }
}

to add size: landscape; in the @page selector and in @media print to make the page print in landscape mode.

The page styles in unaffected when displayed in a browser tab.

Conclusion

To print in landscape with CSS, we use the size property.

Leave a Reply

Your email address will not be published.