Sticking custom footer on each page to bottom while printing

后端 未结 4 1070
囚心锁ツ
囚心锁ツ 2020-12-14 10:56

I want to print 30 pages with some data on top and some data on bottom. My code looks like:

<...>



4条回答
  •  我在风中等你
    2020-12-14 11:08

    Finally found an answer:

    1. html,body MUST HAVE height: 100%;
    2. There should be two types of div: outside (size of page), footer
    3. For both set display: block;
    4. For the outside set height: 100%; position: relative;
    5. For the inside set position: absolute; bottom: 0px;

    Voila!

    Here is my complete code:

    
    
    
        
    
    
        
    Page1
    Page1Footer
    Page2
    Page2Footer
    Page3
    Page3Footer

提交回复
热议问题