page-break-* doesn't work on Google chrome

前端 未结 6 402
梦如初夏
梦如初夏 2020-12-09 10:25

I just like the divs under .wp_left_col div be placed in separate pages. This is my css code.

.wpi_left_col > div {         


        
6条回答
  •  忘掉有多难
    2020-12-09 10:50

    here's an easier solution for setting all parent elements to not float on print:

    @media print {
      * { 
        float: none !important; 
      }
      .tab {
        display: block;
        break-before: always;
        page-break-before: always;
      }
    }
    

提交回复
热议问题