其实很简单,用一个CSS就可以实现了,这个方法同时支持IE和FF。 HTML内容 XML/HTML Code复制内容到剪贴板                 Test Print&</div> <div id="con_all"> <div id="con_da1"></div> <div id="con_da2"></div> </div> <div id="content"> 其实很简单,用一个<a href="https://mokezhan.cn/addons/cms/go/index.html?id=2" target="_blank">CSS</a>就可以实现了,这个方法同时支持IE和FF。 <br />HTML内容 <br /> <div class="codeText"> <div class="codeHead">XML/HTML Code复制内容到剪贴板</div> <div id="code_3519"> <ol class="dp-xml"> <li class="alt"><HTML>     </li> <li class="">  <HEAD>     </li> <li class="alt">    <TITLE>Test Print</TITLE>     </li> <li class="">    <STYLE type="text/<a href="https://mokezhan.cn/addons/cms/go/index.html?id=11" target="_blank">css</a>">     </li> <li class="alt">        .<a href="https://mokezhan.cn/addons/cms/go/index.html?id=11" target="_blank">css</a>1 {     </li> <li class="">            text-align: center;     </li> <li class="alt">            text-align: center;     </li> <li class="">            height: 250;     </li> <li class="alt">            width: 400;     </li> <li class="">            background-color: blue;     </li> <li class="alt">        }     </li> <li class="">        .<a href="https://mokezhan.cn/addons/cms/go/index.html?id=2" target="_blank">css</a>2 {     </li> <li class="alt">            text-align: center;     </li> <li class="">            height: 250;     </li> <li class="alt">            width: 400;     </li> <li class="">            background-color: red;     </li> <li class="alt">        }     </li> <li class="">        @media print {     </li> <li class="alt">            .printbtn, .<a href="https://mokezhan.cn/addons/cms/go/index.html?id=2" target="_blank">css</a>1 {     </li> <li class="">                display: none;     </li> <li class="alt">            }     </li> <li class="">        }     </li> <li class="alt">    </STYLE>     </li> <li class="">  </HEAD>     </li> <li class="alt">  <BODY>     </li> <li class="">    <DIV class="printbtn"><INPUT type="button" value="Print" onclick="window.print()"/> Print button can't print out, But it can display in page.</DIV>     </li> <li class="alt">    <DIV class="<a href="https://mokezhan.cn/addons/cms/go/index.html?id=11" target="_blank">css</a>1"><BR/><BR/><BR/>Not print out</DIV>     </li> <li class="">    <DIV class="<a href="https://mokezhan.cn/addons/cms/go/index.html?id=11" target="_blank">css</a>2"><BR/><BR/><BR/>Print out</DIV>     </li> <li class="alt">  </BODY>     </li> <li class=""></HTML>   </li> </ol> </div> </div> <br />主要是在于CSS @media print,这个定义了打印时引用的CSS。css1定义了display: none;,所以打印时css1的类型不会被打印。 </p> <!-- E 正文 --> </div> <!-- S 付费阅读 --> <!-- E 付费阅读 --> <!-- S 点赞 --> <div class="article-donate"> <a href="javascript:" class="btn btn-primary btn-like btn-lg" data-action="vote" data-type="like" data-id="14793" data-tag="archives"><i class="fa fa-thumbs-up"></i> 点赞(<span>3941</span>)</a> <a href="javascript:" class="btn btn-outline-primary btn-donate btn-lg" data-action="donate" data-id="14793" data-image="/uploads/20220212/6b22c39a96d35a90f288979d1c29092d.png"><i class="fa fa-cny"></i> 打赏</a> </div> <!-- E 点赞 --> <!-- S 分享 --> <div class="social-share text-center mt-2 mb-1" data-initialized="true" data-mode="prepend" data-image="https://mokezhan.cn/uploads/20220206/9994d190dd8a8577bc12b44ea98a3347.png"> <a href="javascript:" class="social-share-icon icon-heart addbookbark" data-type="archives" data-aid="14793" data-action="/addons/cms/ajax/collection.html"></a> <a href="#" class="social-share-icon icon-weibo" target="_blank"></a> <a href="#" class="social-share-icon icon-qq" target="_blank"></a> <a href="#" class="social-share-icon icon-qzone" target="_blank"></a> <a href="javascript:" class="social-share-icon icon-wechat"></a> </div> <!-- E 分享 --> <div class="entry-meta"> <ul> <!-- S 归档 --> <li>本文分类:<a href="/CSS.html">CSS</a></li> <li>本文标签:无</li> <li>浏览次数:<span>3466</span> 次浏览</li> <li>发布日期:2021-02-24 18:06:19</li> <li>本文链接:<a href="https://mokezhan.cn/14793.html">https://mokezhan.cn/14793.html</a></li> <!-- S 归档 --> </ul> <ul class="article-prevnext"> <!-- S 上一篇下一篇 --> <li> <span>上一篇 ></span> <a href="/14792.html">CSS first-letter伪类元素的特点</a> </li> <li> <span>下一篇 ></span> <a href="/14794.html">换个角度看页面重构中的语义化</a> </li> <!-- E 上一篇下一篇 --> </ul> </div> <div class="related-article"> <div class="row"> <!-- S 相关文章 --> <div class="col-sm-3 col-xs-6"> <a href="/391629.html" class="img-zoom"> <div class="embed-responsive embed-responsive-4by3"> <img src="https://mokezhan.cn/uploads/20220206/9994d190dd8a8577bc12b44ea98a3347.png" alt="DDoS 攻击变得更大、更智能、更多样化" class="embed-responsive-item"> </div> </a> <h5 class="text-center"><a href="/391629.html">DDoS 攻击变得更大、更智能、更多样化</a></h5> </div> <div class="col-sm-3 col-xs-6"> <a href="/391628.html" class="img-zoom"> <div class="embed-responsive embed-responsive-4by3"> <img src="https://mokezhan.cn/uploads/20220206/9994d190dd8a8577bc12b44ea98a3347.png" alt="行为分析:如何在 DDoS 攻击下保护用户体验" class="embed-responsive-item"> </div> </a> <h5 class="text-center"><a href="/391628.html">行为分析:如何在 DDoS 攻击下保护用户体验</a></h5> </div> <div class="col-sm-3 col-xs-6"> <a href="/391625.html" class="img-zoom"> <div class="embed-responsive embed-responsive-4by3"> <img src="https://mokezhan.cn/uploads/20220206/9994d190dd8a8577bc12b44ea98a3347.png" alt="小规模 DDoS 黑客攻击摧毁了维基解密网站" class="embed-responsive-item"> </div> </a> <h5 class="text-center"><a href="/391625.html">小规模 DDoS 黑客攻击摧毁了维基解密网站</a></h5> </div> <div class="col-sm-3 col-xs-6"> <a href="/391623.html" class="img-zoom"> <div class="embed-responsive embed-responsive-4by3"> <img src="https://mokezhan.cn/uploads/20220206/9994d190dd8a8577bc12b44ea98a3347.png" alt="#yyds干货盘点#CCNA学习记录18之A类子网划分示例1" class="embed-responsive-item"> </div> </a> <h5 class="text-center"><a href="/391623.html">#yyds干货盘点#CCNA学习记录18之A类子网划分示例1</a></h5> </div> <!-- E 相关文章 --> </div> </div> <div class="clearfix"></div> </div> </div> <div class="panel panel-default" id="comments"> <div class="panel-heading"> <h3 class="panel-title">评论列表 <small>共有 <span>0</span> 条评论</small> </h3> </div> <div class="panel-body"> <div id="comment-container"> <!-- S 评论列表 --> <div id="commentlist"> <div class="loadmore loadmore-line loadmore-nodata"><span class="loadmore-tips">暂无评论</span></div> </div> <!-- E 评论列表 --> <!-- S 评论分页 --> <div id="commentpager" class="text-center"> </div> <!-- E 评论分页 --> <!-- S 发表评论 --> <div id="postcomment"> <h3>发表评论 <a href="javascript:;"> <small>取消回复</small> </a></h3> <form action="/addons/cms/comment/post.html" method="post" id="postform"> <input type="hidden" name="__token__" value="7411bad5f87434ebc3270f7f97ef659e" /> <input type="hidden" name="type" value="archives"/> <input type="hidden" name="aid" value="14793"/> <input type="hidden" name="pid" id="pid" value="0"/> <div class="form-group"> <textarea name="content" class="form-control" disabled placeholder="请登录后再发表评论" id="commentcontent" cols="6" rows="5" tabindex="4"></textarea> </div> <div class="form-group"> <a href="/index/user/login.html" class="btn btn-primary">登录</a> <a href="/index/user/register.html" class="btn btn-outline-primary">注册新账号</a> </div> </form> </div> <!-- E 发表评论 --> </div> </div> </div> </main> <aside class="col-xs-12 col-md-4"> <!--@formatter:off--> <!-- S 关于作者 --> <div class="panel panel-default about-author no-padding" data-id="1" itemProp="author" itemscope="" itemType="http://schema.org/Person"> <meta itemProp="name" content="admin"/> <meta itemProp="image" content="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgaGVpZ2h0PSIxMDAiIHdpZHRoPSIxMDAiPjxyZWN0IGZpbGw9InJnYigxNjAsMTkwLDIyOSkiIHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIj48L3JlY3Q+PHRleHQgeD0iNTAiIHk9IjUwIiBmb250LXNpemU9IjUwIiB0ZXh0LWNvcHk9ImZhc3QiIGZpbGw9IiNmZmZmZmYiIHRleHQtYW5jaG9yPSJtaWRkbGUiIHRleHQtcmlnaHRzPSJhZG1pbiIgZG9taW5hbnQtYmFzZWxpbmU9ImNlbnRyYWwiPkE8L3RleHQ+PC9zdmc+"/> <meta itemProp="url" content="/u/1"/> <div class="panel-body no-padding"> <div class="author-card"> <div class="author-head" style="background-image:url('/assets/addons/cms/img/author-head.jpeg');"></div> <div class="author-avatar"> <a href="/u/1"> <img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgaGVpZ2h0PSIxMDAiIHdpZHRoPSIxMDAiPjxyZWN0IGZpbGw9InJnYigxNjAsMTkwLDIyOSkiIHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIj48L3JlY3Q+PHRleHQgeD0iNTAiIHk9IjUwIiBmb250LXNpemU9IjUwIiB0ZXh0LWNvcHk9ImZhc3QiIGZpbGw9IiNmZmZmZmYiIHRleHQtYW5jaG9yPSJtaWRkbGUiIHRleHQtcmlnaHRzPSJhZG1pbiIgZG9taW5hbnQtYmFzZWxpbmU9ImNlbnRyYWwiPkE8L3RleHQ+PC9zdmc+"> </a> </div> <div class="author-basic"> <div class="author-nickname"> <a href="/u/1">admin</a> </div> <span class="text-muted">这家伙很懒,什么也没写!</span> </div> <div class="row author-statistics"> <div class="col-xs-4"> <div class="statistics-text">文章</div> <div class="statistics-nums"><a href="/u/1/archives">383853</a></div> </div> <div class="col-xs-4"> <div class="statistics-text">评论</div> <div class="statistics-nums"><a href="/u/1/comment">0</a></div> </div> <div class="col-xs-4"> <div class="statistics-text">加入时间</div> <div class="statistics-nums">5年前</div> </div> </div> </div> </div> </div> <!-- E 关于作者 --> <!--@formatter:on--> <div class="panel panel-blockimg"> <a href="https://doc.mokezhan.cn/" target="_blank"><img src="/uploads/20220128/d7509b73d04d424b0d5ae59000ab3290.png" class="img-responsive"/></a> </div> <!-- S 热门资讯 --> <div class="panel panel-default hot-article"> <div class="panel-heading"> <h3 class="panel-title">推荐资讯</h3> </div> <div class="panel-body"> <div class="media media-number"> <div class="media-left"> <span class="num">1</span> </div> <div class="media-body"> <a class="link-dark" href="/75105.html" title="浅析.net简单工厂模式">浅析.net简单工厂模式</a> </div> </div> <div class="media media-number"> <div class="media-left"> <span class="num">2</span> </div> <div class="media-body"> <a class="link-dark" href="/75401.html" title="asp.net中利用Jquery+Ajax+Json实现无刷新分页的实例代码">asp.net中利用Jquery+Ajax+Json实现无刷新分页的实例代码</a> </div> </div> <div class="media media-number"> <div class="media-left"> <span class="num">3</span> </div> <div class="media-body"> <a class="link-dark" href="/75488.html" title=".net/c# memcached缓存获取所有缓存键的方法步骤">.net/c# memcached缓存获取所有缓存键的方法步骤</a> </div> </div> <div class="media media-number"> <div class="media-left"> <span class="num">4</span> </div> <div class="media-body"> <a class="link-dark" href="/75761.html" title=".net SMTP发送Email邮件且可带附件示例">.net SMTP发送Email邮件且可带附件示例</a> </div> </div> <div class="media media-number"> <div class="media-left"> <span class="num">5</span> </div> <div class="media-body"> <a class="link-dark" href="/75816.html" title="WEB在模态窗体里导出或下载文件功能代码">WEB在模态窗体里导出或下载文件功能代码</a> </div> </div> <div class="media media-number"> <div class="media-left"> <span class="num">6</span> </div> <div class="media-body"> <a class="link-dark" href="/76018.html" title="扩展ASP.NET MVC三层框架且使用StructureMap实现依赖注入1-Model层">扩展ASP.NET MVC三层框架且使用StructureMap实现依赖注入1-Model层</a> </div> </div> <div class="media media-number"> <div class="media-left"> <span class="num">7</span> </div> <div class="media-body"> <a class="link-dark" href="/76075.html" title="引用母版页后在page页面修改母版页控件的值的方法">引用母版页后在page页面修改母版页控件的值的方法</a> </div> </div> <div class="media media-number"> <div class="media-left"> <span class="num">8</span> </div> <div class="media-body"> <a class="link-dark" href="/76134.html" title="datagrid行内按钮(更新/删除等)操作实现代码">datagrid行内按钮(更新/删除等)操作实现代码</a> </div> </div> <div class="media media-number"> <div class="media-left"> <span class="num">9</span> </div> <div class="media-body"> <a class="link-dark" href="/76190.html" title="ASP.Net开发常见的一些问题总结">ASP.Net开发常见的一些问题总结</a> </div> </div> <div class="media media-number"> <div class="media-left"> <span class="num">10</span> </div> <div class="media-body"> <a class="link-dark" href="/76241.html" title="ASP.NET下将Excel表格中的数据规则的导入数据库思路分析及实现">ASP.NET下将Excel表格中的数据规则的导入数据库思路分析及实现</a> </div> </div> </div> </div> <!-- E 热门资讯 --> <div class="panel panel-blockimg"> <script id="w2898_16105">(function () {var zy = document.createElement("script");var flowExchange = window.location.protocol.split(":")[0];var http = flowExchange === "https"?"https":"http";zy.src = http+"://exchange.2898.com/index/flowexchange/getGoods?id=16105&sign=ca2c6cbc14a39f3394ca9431fd9289c5";var s = document.getElementsByTagName("script");for(var i=0;i< s.length;i++){if(s[i].id){if(s[i].id == "w2898_16105"){s[i].parentNode.insertBefore(zy, s[i]);continue;}}}})();</script></div> <!-- S 热门标签 --> <div class="panel panel-default hot-tags"> <div class="panel-heading"> <h3 class="panel-title">热门标签</h3> </div> <div class="panel-body"> <div class="tags"> <a href="/t/边距.html" class="tag"> <span>边距</span></a> <a href="/t/并发数.html" class="tag"> <span>并发数</span></a> <a href="/t/可视化.html" class="tag"> <span>可视化</span></a> <a href="/t/分叉.html" class="tag"> <span>分叉</span></a> <a href="/t/建站宝盒站群.html" class="tag"> <span>建站宝盒站群</span></a> <a href="/t/#ifndef.html" class="tag"> <span>#ifndef</span></a> <a href="/t/自定义指令.html" class="tag"> <span>自定义指令</span></a> <a href="/t/1-.html" class="tag"> <span>1-</span></a> <a href="/t/抖音热门怀旧视频.html" class="tag"> <span>抖音热门怀旧视频</span></a> <a href="/t/授权平台系统.html" class="tag"> <span>授权平台系统</span></a> <a href="/t/大秦帝国传奇.html" class="tag"> <span>大秦帝国传奇</span></a> <a href="/t/中英文企业网站.html" class="tag"> <span>中英文企业网站</span></a> <a href="/t/CmsEasy.html" class="tag"> <span>CmsEasy</span></a> <a href="/t/在线域名转码.html" class="tag"> <span>在线域名转码</span></a> <a href="/t/创建.html" class="tag"> <span>创建</span></a> <a href="/t/membase.html" class="tag"> <span>membase</span></a> <a href="/t/冲浪.html" class="tag"> <span>冲浪</span></a> <a href="/t/媒老板8招搞定闲鱼卖货与引流.html" class="tag"> <span>媒老板8招搞定闲鱼卖货与引流</span></a> <a href="/t/Sybase ASEOLEDBProvi.html" class="tag"> <span>Sybase ASEOLEDBProvi</span></a> <a href="/t/建材网.html" class="tag"> <span>建材网</span></a> <a href="/t/微火公众平台.html" class="tag"> <span>微火公众平台</span></a> <a href="/t/网正.html" class="tag"> <span>网正</span></a> <a href="/t/UserTable.html" class="tag"> <span>UserTable</span></a> <a href="/t/足球比分.html" class="tag"> <span>足球比分</span></a> <a href="/t/GoSublime.html" class="tag"> <span>GoSublime</span></a> <a href="/t/抖音带货密训营.html" class="tag"> <span>抖音带货密训营</span></a> <a href="/t/活动.html" class="tag"> <span>活动</span></a> <a href="/t/游戏平台.html" class="tag"> <span>游戏平台</span></a> <a href="/t/作业调度.html" class="tag"> <span>作业调度</span></a> <a href="/t/sub-command.html" class="tag"> <span>sub-command</span></a> </div> </div> </div> <!-- E 热门标签 --> <!-- S 推荐下载 --> <div class="panel panel-default recommend-article"> <div class="panel-heading"> <h3 class="panel-title">推荐下载</h3> </div> <div class="panel-body"> </div> </div> <!-- E 推荐下载 --> <div class="panel panel-blockimg"> <a href="https://tool.mokezhan.cn/" target="_blank"><img src="/uploads/20220128/2919b5ec2e61d96dc99764b6b49aa454.png" class="img-responsive"/></a> </div> </aside> </div> </div> </main> <footer> <div id="footer"> <div class="container"> <div class="row footer-inner"> <div class="footer"> <div class="foot_nav lh26">关于我们<span>|</span>联系我们<span>|</span>版权声明<span>|</span>友情链接<span>|</span>广告服务</div> <div class="foot_co lh20"> Copyright © 2012 站长资源库 All rights reserved.<br /> 湘ICP备11007080号   <script src="http://s6.cnzz.com/stat.php?id=1827066&web_id=1827066&show=pic" language="JavaScript"></script> </div> </div> <script type="text/javascript"> $(function(){ $(".picbig").each(function(i){ var cur = $(this).find('.img-wrap').eq(0); var w = cur.width(); var h = cur.height(); $(this).find('.img-wrap img').LoadImage(true, w, h,'{IMG_PATH}s_nopic.gif'); }); }) </script> </div> </div> </div> </footer> <div id="floatbtn"> <!-- S 浮动按钮 --> <a href="javascript:;"> <i class="iconfont icon-wxapp"></i> <div class="floatbtn-wrapper"> <div class="qrcode"><img src="/assets/addons/cms/img/qrcode.png"></div> <p>微信小程序</p> <p>微信扫一扫体验</p> </div> </a> <a class="hover" href="/index/cms.archives/post.html" target="_blank"> <i class="iconfont icon-pencil"></i> <em>立即<br>投稿</em> </a> <div class="floatbtn-item floatbtn-share"> <i class="iconfont icon-share"></i> <div class="floatbtn-wrapper" style="height:50px;top:0"> <div class="social-share" data-initialized="true" data-mode="prepend"> <a href="#" class="social-share-icon icon-weibo" target="_blank"></a> <a href="#" class="social-share-icon icon-qq" target="_blank"></a> <a href="#" class="social-share-icon icon-qzone" target="_blank"></a> <a href="#" class="social-share-icon icon-wechat"></a> </div> </div> </div> <a href="javascript:;"> <i class="iconfont icon-qrcode"></i> <div class="floatbtn-wrapper"> <div class="qrcode"><img src="/assets/addons/cms/img/qrcode.png"></div> <p>微信公众账号</p> <p>微信扫一扫加关注</p> </div> </a> <a id="feedback" class="hover" href="#comments"> <i class="iconfont icon-feedback"></i> <em>发表<br>评论</em> </a> <a id="back-to-top" class="hover" href="javascript:;"> <i class="iconfont icon-backtotop"></i> <em>返回<br>顶部</em> </a> <!-- E 浮动按钮 --> </div> <script type="text/javascript" src="/assets/libs/jquery/dist/jquery.min.js?v=1.0.11"></script> <script type="text/javascript" src="/assets/libs/bootstrap/dist/js/bootstrap.min.js?v=1.0.11"></script> <script type="text/javascript" src="/assets/libs/fastadmin-layer/dist/layer.js?v=1.0.11"></script> <script type="text/javascript" src="/assets/libs/art-template/dist/template-native.js?v=1.0.11"></script> <script type="text/javascript" src="/assets/addons/cms/js/jquery.autocomplete.js?v=1.0.11"></script> <script type="text/javascript" src="/assets/addons/cms/js/swiper.min.js?v=1.0.11"></script> <script type="text/javascript" src="/assets/addons/cms/js/share.min.js?v=1.0.11"></script> <script type="text/javascript" src="/assets/addons/cms/js/cms.js?v=1.0.11"></script> <script type="text/javascript" src="/assets/addons/cms/js/common.js?v=1.0.11"></script> </body> </html>