How to design a webpage to be print friendly?

前端 未结 4 1012
失恋的感觉
失恋的感觉 2021-02-09 12:12

What are the right sizes for a webpage to be printed on A4 size paper? What other stuff should be considered?

*inline CSS is preferred in this case

Clari

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-09 12:21

    the best way is use from @Media command in stylesheet

    for example

    @media print{}
    

    use for print layout of all control and

    @media screen{}
    

    used for screen layout of control, just think you have a

    content

    and then in your media you should have

    @media print{ .wrapper{width: 100%;background-color:Transparent;color:Black;}}
    

    and

    @media screen{ .wrapper{width: 100%;background-color:#cdebcd;color:Red;}}
    

    with this @media you can style your layout totaly different for print and screen. you can also use

    .SomeDivOrContent{visibility:hidden;display:none;}
    

    to hide ites in print.

    let me know was it helpfull or not

提交回复
热议问题