📜  仅打印 div - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:05.080000             🧑  作者: Mango

代码示例1
@media print {
  body * {
    visibility: hidden;
  }
  #section-to-print, #section-to-print * {
    visibility: visible;
  }
  #section-to-print {
    position: absolute;
    left: 0;
    top: 0;
  }
}