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

推荐订阅源

Martin Fowler
Martin Fowler
Jina AI
Jina AI
J
Java Code Geeks
Microsoft Security Blog
Microsoft Security Blog
Recent Announcements
Recent Announcements
I
InfoQ
L
LangChain Blog
The Cloudflare Blog
IT之家
IT之家
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Last Week in AI
Last Week in AI
Blog — PlanetScale
Blog — PlanetScale
罗磊的独立博客
云风的 BLOG
云风的 BLOG
Microsoft Azure Blog
Microsoft Azure Blog
Engineering at Meta
Engineering at Meta
F
Fortinet All Blogs
博客园 - 聂微东
美团技术团队
博客园_首页

博客园 - 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:用于所有媒体。