慕容的工作随笔

慕容的工作随笔

记录学习和工作

打印时隐藏HTML页面的按钮 转

转自:http://www.voidcn.com/article/p-xqkurcwz-buc.html

可使用CSS @media。例如:

@media print {
    .noprint {
        display: none;
    }
}
   <div>
        测试Electron打印页面内容
    </div>
    <div class="btn_container noprint">
      <button type="button" onclick="printBtn()" >打印</button>
    </div>
@media打印块中定义的样式,仅在打印页面时应用。

评论 (0)

还没有评论,来做第一个吧。

发表评论

提交后需管理员审核通过后显示