Print header/footer on all pages (Print Mode)

前端 未结 4 1861
悲哀的现实
悲哀的现实 2020-12-13 10:38
header
content spanning several pages...
Footer - Fixed at
4条回答
  •  星月不相逢
    2020-12-13 10:59

    If you're willing to switch over to tables for your layout (not necessarily ideal), you can do it with the and elements. They'll print at the top and bottom of every page:

    Another option is to use display table-header-group and table-footer-group but cross-browser support isn't great:

    #header {
      display: table-header-group;
    }
    
    #main {
      display: table-row-group;
    }
    
    #footer {
      display: table-footer-group;
    }
    

提交回复
热议问题