header and footer in each page in print mode with css

前端 未结 4 1715
北海茫月
北海茫月 2021-02-01 19:28

I have a web application and it has a report that might exceed one page and I would like to print a header and footer in every page. i find and try this: Repeating a report head

4条回答
  •  情话喂你
    2021-02-01 20:05

    I found a solution that worked for me and only one that works without problem.

    In html

     
    Custom Footer

    in css

                header, .header-space,
                footer, .footer-space {
                    height: 100px;
                    font-weight: bold;
                    width: 100%;
                    padding: 10pt;
                    margin: 10pt 0;
                }
    
                header {
                    position: fixed;
                    top: 0;
                    border-bottom: 1px solid black;
                }
    
                footer {
                    position: fixed;
                    bottom: 0;
                    border-top: 1px solid black;
                }
    

提交回复
热议问题