惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
Help Net Security
Help Net Security
P
Privacy International News Feed
T
Threat Research - Cisco Blogs
C
Cisco Blogs
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
L
LINUX DO - 热门话题
Security Latest
Security Latest
A
Arctic Wolf
G
GRAHAM CLULEY
月光博客
月光博客
S
Securelist
D
Docker
J
Java Code Geeks
T
Troy Hunt's Blog
T
Tenable Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
SecWiki News
SecWiki News
S
Security @ Cisco Blogs
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LINUX DO - 最新话题
Recent Commits to openclaw:main
Recent Commits to openclaw:main
aimingoo的专栏
aimingoo的专栏
博客园 - 【当耐特】
H
Heimdal Security Blog
The Hacker News
The Hacker News
博客园 - 三生石上(FineUI控件)
Application and Cybersecurity Blog
Application and Cybersecurity Blog
N
Netflix TechBlog - Medium
Vercel News
Vercel News
Forbes - Security
Forbes - Security
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
B
Blog
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
Google DeepMind News
Google DeepMind News
S
Secure Thoughts
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Check Point Blog
云风的 BLOG
云风的 BLOG
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Blog of Author Tim Ferriss
L
Lohrmann on Cybersecurity
F
Full Disclosure
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Proofpoint News Feed

博客园 - singleblue

IIS7 asp.net配置默认文档的错误 画图工具 UI层方案征集 B/S项目架构探讨 如何做自动录入数据功能 Failed to execute request because the App-Domain could not be created 解决ie7以下浏览器PNG图片背景不透明且链接失效的办法 拼接字符串的效率(转载) 最近准备用的数据访问类,欢迎拍砖! 关于JSON的文章 求助:如何合并两个PDF文档 取水晶报表的总页数 javascript操作cookie javascript全角半角问题 以支持多种浏览器的方式创建XMLHttpRequest对象 四种引用 使用AjaxPro与Session交互时遇到一个问题 急求datastage 控件隐藏(Visible=false)的一个问题
window.print()
singleblue · 2008-05-21 · via 博客园 - singleblue

调用window.print()时,可以利用css来控制页面中的东西是否显示

<style>

@media print{

  .noprint{

     display:none

  }

}

</style>

HTML如下:

<table width="757" height="174" border="0" align="center"cellpadding="0"

cellspacing="0">

 <tr class="noprint">

  <td height="133" align="center" valign="top">

   <img src="Images/top.jpg" width="757" height="133"></td>

 </tr>
</table>
此时<tr class="noprint">是不打印的tr

下面是media的相关

media类型是CSS属性媒体类型,用于直接引入媒体的属性。其语法格式如下:

@media screen | print | projection | braille | aural | tv | handheld | all

参数说明

    screen:指计算机屏幕。

    print:指用于打印机的不透明介质。

    projection:指用于显示的项目。

    braille:盲文系统,指有触觉效果的印刷品。

    aural:指语音电子合成器。

    tv:电视类型的媒体。

    handheld:指手持式显示设备。

    all:用于所有媒体。