开发者

Is there a way to make my html page print horizontally by default?

开发者 https://www.devze.com 2022-12-12 10:25 出处:网络
I hit print by accident earlier and realised my page looked awful printed vertically开发者_运维知识库 when it came out of the printer. Is there a property I can set in the code to make it print horizo

I hit print by accident earlier and realised my page looked awful printed vertically开发者_运维知识库 when it came out of the printer. Is there a property I can set in the code to make it print horizontally by default?


Use landscape for the page size and media="print":

<style type="text/css" >
@page
{
    size: landscape;
    margin: 2cm;
}
</style>

Doesn't work with IE6 but should work with IE7 and better or any other browser.

See this article.


In the CSS you can do:

@page {
  size: landscape
}

But I'm not sure about browser support.

You could always make the design more fluid ;-)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号