在打印网页时,我该如何隐藏一个元素?
要隐藏元素,在元素中添加 "display:none",使用 CSS。
<style>
@media print {
.noprint {
visibility: hidden;
}
}
</style>同时,添加你想隐藏在 <div>− 中的元素
<div id="noprint"> Add here the element, which you want to hide. </div>
广告
要隐藏元素,在元素中添加 "display:none",使用 CSS。
<style>
@media print {
.noprint {
visibility: hidden;
}
}
</style>同时,添加你想隐藏在 <div>− 中的元素
<div id="noprint"> Add here the element, which you want to hide. </div>