<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title><![CDATA[志文工作室 - 计算机技术学习博客 - 网站建设]]></title>
<link>http://www.zhiwenweb.cn/</link>
<description><![CDATA[每天知道多一点]]></description>
<language>zh-cn</language>
<copyright><![CDATA[Copyright 2005 PBlog3 v2.8]]></copyright>
<webMaster><![CDATA[lzwy0820@qq.com(任侠)]]></webMaster>
<generator>PBlog2 v2.4</generator> 
<image>
	<title>志文工作室 - 计算机技术学习博客</title>
	<url>http://www.zhiwenweb.cn/images/logos.gif</url>
	<link>http://www.zhiwenweb.cn/</link>
	<description>志文工作室 - 计算机技术学习博客</description>
</image>

			<item>
			<link>http://www.zhiwenweb.cn/article.asp?id=1204</link>
			<title><![CDATA[外部调用js失效或乱码：JavaScript脚本改为外部引用后失效或出现乱码的原因与解决方法]]></title>
			<author>lzwy0820@qq.com(任侠)</author>
			<category><![CDATA[网站建设]]></category>
			<pubDate>Wed,11 Aug 2010 18:22:11 +0800</pubDate>
			<guid>http://www.zhiwenweb.cn/default.asp?id=1204</guid>
		<description><![CDATA[<p>为了网站页面的&ldquo;瘦身&rdquo;，于是将一些通用的代码放进js里面，然后就总是出现了问题。下面是通过反复调试得到的原因与解决方案，在此记录一下以供参考交流。</p>
<h2>问题描述</h2>
<p>JavaScript代码放在网页页面时，功能效果是正常的。但是当放在脚本里然后引用进来时，功能就失效了。</p>
<p>例如</p>
<p>网页里代码如下：<br />
<span style="background-color: yellow">&lt;script type=&quot;text/javascript&quot;&gt;<br />
&nbsp;&nbsp;&nbsp; function nTabs(tabObj, obj) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var tabList = document.getElementById(tabObj).getElementsByTagName(&quot;li&quot;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i = 0; i &lt; tabList.length; i++) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (tabList[i].id == obj.id) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.getElementById(tabObj + &quot;_Title&quot; + i).className = &quot;active&quot;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.getElementById(tabObj + &quot;_Content&quot; + i).style.display = &quot;block&quot;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.getElementById(tabObj + &quot;_Title&quot; + i).className = &quot;normal&quot;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.getElementById(tabObj + &quot;_Content&quot; + i).style.display = &quot;none&quot;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }<br />
&lt;/script&gt;</span></p>
<p>但是当保存为tab.js,然后如下方式引用时，就没有效果了<br />
<span style="background-color: yellow">&lt;script language='javascript' src='tab.js'&gt;</span></p>
<h2>原因与解决方案</h2>
<p>其实这里可能有两个可能的原因：</p>
<p>一个是当你把这段代码放到网页的后面时，就会发现功能有效了。<br />
这里放在后面是因为存在一个document ready 的问题。<br />
从网络打开html文档总是有一个延迟的问题，在运行你的script程序的时候，文档可能没有完全加载。</p>
<p>第二个可能就是编码的问题。如果你测试一下，在你的脚本文件（如tab.js）里输出一段文字，如加入代码：</p>
<p><span style="background-color: yellow">document.writeln(&quot;志文工作室&quot;);</span></p>
<p>然后再刷新网页，如果没有正常出现文字，而是出现了乱码，那么就应该是编码的问题。这里你可以用网页编辑工具如dreamweaver、editplus等新建js文件，然后复制进代码，问题即可解决。</p>]]></description>
		</item>
		
			<item>
			<link>http://www.zhiwenweb.cn/article.asp?id=1191</link>
			<title><![CDATA[基于jQuery.Lazyload 为网站（PJblog）添加当鼠标滑到当前屏时图片渐隐载入显示效果]]></title>
			<author>lzwy0820@qq.com(任侠)</author>
			<category><![CDATA[网站建设]]></category>
			<pubDate>Thu,24 Jun 2010 14:17:23 +0800</pubDate>
			<guid>http://www.zhiwenweb.cn/default.asp?id=1191</guid>
		<description><![CDATA[<p>在浏览很多博客特别是WordPress类的博客的时候，经常能看到那种当鼠标滚动到图片位置时，图片才渐隐显示出来的效果，一直感觉都很不错。因为这个效果体验很好，而且在加载速度等方面也很不错。<br />
刚在一个博客（自力博客）里看到该效果的wp添加方法，发现该效果其实可以添加到任何网站上的，于是就将其用在本博客上了。具体效果可以参看下面的实例图片。下面说一下在网站上添加该效果的方法。</p>
<p><strong>一、特效优点</strong></p>
<p>1、加速站点的页面载入速度； <br />
2、不唐突的图片渐显方式； <br />
3、代码精简，便于操作维护，JS代码仅仅 1.6KB&nbsp; 先决条件是：你的站加载了 Jquery.js</p>
<p><strong>二、原理：</strong></p>
<p>能判断访客是不是在查看当前图片，若非，则加载 预留的填充图片 fill.gif ，等访客滑动鼠标滑轮或浏览到图片位置时，真正的图片地址才回加载。 <br />
不用用担心对访客的有好程度，这个效果会在图片即将被浏览到的时候就开始加载图片。</p>
<p><strong>三、特效缺点</strong></p>
<p>有一个，是关于img，height限定的问题，即当没有设置img的宽度和高度时，默认显示的fill.gif图片因为太小而看不到图片位置。不过你可以自己设计一个小但是图片稍大的图片来代替fill.gif。</p>
<p><strong>四、实现方法</strong></p>
<p>1、下载 jquery.lazyload.js和fill.gif文件，这里提供下载：<a href="http://www.zhiwenweb.cn/download.asp?id=48"><img alt="" border="0" style="margin: 0px 2px -4px 0px" src="http://www.zhiwenweb.cn/images/download.gif" />点击下载此文件</a></p>
<p>2、将上面下载到的文件放到网站根目录，或者自定义一个位置（注意如果修改的话，后面引用这些文件时的路径也要同时修改）<br />
<em>pjblog的话放到根目录即可，会覆盖进插件的目录里</em></p>
<p>3、网页的头部（即&lt;head&gt;&lt;/head&gt;部分）中适当位置添加下面的代码。<br />
<em>pjblog添加在header.asp文件里即可，全静态则应添加在Template/static.htm文件里。</em><br />
注意：红色部分可以限定只对文章中特定标签内的img生效，比如修改成 $(&quot;.content img&quot;)等。</p>
<blockquote>
<p>&nbsp;&nbsp;&nbsp; &lt;script type=text/javascript&gt;// &lt;![CDATA[<br />
&nbsp;&nbsp;&nbsp; jQuery(document).ready(<br />
&nbsp;&nbsp;&nbsp; function($){<br />
&nbsp;&nbsp;&nbsp; $(&quot;img&quot;).lazyload({<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; placeholder : &quot;/Plugins/jQueryLazyload/fill.gif&quot;,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; effect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : &quot;fadeIn&quot;<br />
&nbsp;&nbsp;&nbsp; });<br />
&nbsp;&nbsp;&nbsp; });<br />
&nbsp;&nbsp;&nbsp; // ]]&gt;&lt;/script&gt;</p>
</blockquote>
<p>效果预览（往下滚动鼠标，N多图片示例）：</p>
<p style="text-align: center">&nbsp;<img height="737" alt="" width="500" src="http://www.zhiwenweb.cn//Plugins/FPV/samplePhoto/ALBUM/prettygirls/00148.jpg" /></p>
<p style="text-align: center">&nbsp;</p>
<p style="text-align: center"><img height="713" alt="" width="500" src="http://www.zhiwenweb.cn//Plugins/FPV/samplePhoto/ALBUM/prettygirls/00149.jpg" /></p>
<p style="text-align: center">&nbsp;</p>
<p style="text-align: center"><img height="672" alt="" width="500" src="http://www.zhiwenweb.cn//Plugins/FPV/samplePhoto/ALBUM/prettygirls/00140.jpg" /></p>
<p style="text-align: center">&nbsp;</p>
<p style="text-align: center"><img height="604" alt="" width="500" src="http://www.zhiwenweb.cn//Plugins/FPV/samplePhoto/ALBUM/prettygirls/00036.jpg" /></p>
<p style="text-align: center">&nbsp;</p>
<p style="text-align: center"><img height="750" alt="" width="500" src="http://www.zhiwenweb.cn//Plugins/FPV/samplePhoto/ALBUM/prettygirls/00132.jpg" /></p>
<p style="text-align: center">&nbsp;</p>
<p style="text-align: center"><img height="750" alt="" width="500" src="http://www.zhiwenweb.cn//Plugins/FPV/samplePhoto/ALBUM/prettygirls/000165.jpg" /></p>
<p style="text-align: center">&nbsp;</p>]]></description>
		</item>
		
			<item>
			<link>http://www.zhiwenweb.cn/article.asp?id=1189</link>
			<title><![CDATA[pjblog352版本文章内JavaScript等脚本无法正常显示之临时解决办法]]></title>
			<author>lzwy0820@qq.com(任侠)</author>
			<category><![CDATA[网站建设]]></category>
			<pubDate>Sat,19 Jun 2010 20:48:00 +0800</pubDate>
			<guid>http://www.zhiwenweb.cn/default.asp?id=1189</guid>
		<description><![CDATA[<p>&nbsp;pjblog352版本可能是出于过滤危险脚本的原因，在提交的文章以及描述、标签等内容里，当包含JavaScript、script、VBScript等关键字时，一律会将其中的字母p替换为#112; ，所以会导致文章内容不能正常显示。</p>
<p><span style="color: #0000ff">临时解决方法（修改后可能有未知安全风险，不过咱小博客一般无需考虑过多）：</span></p>
<p>打开文件：<span style="color: #0000ff">common/function.asp</span>，查找如下代码（应该是在<span style="color: #0000ff">170</span>行）：</p>
<blockquote>
<p>&nbsp;&nbsp; re.Pattern = &quot;(java)(script)&quot;<br />
&nbsp;&nbsp; Str = re.Replace(Str, &quot;$1scri&amp;#112;t&quot;)<br />
&nbsp;&nbsp; re.Pattern = &quot;(j)(script)&quot;<br />
&nbsp;&nbsp; Str = re.Replace(Str, &quot;$1scri&amp;#112;t&quot;)<br />
&nbsp;&nbsp; re.Pattern = &quot;(vb)(script)&quot;<br />
&nbsp;&nbsp; Str = re.Replace(Str, &quot;$1scri&amp;#112;t&quot;)</p>
</blockquote>
<p>将之注释掉，即修改为如下代码：</p>
<blockquote>
<p>'&nbsp;re.Pattern = &quot;(java)(script)&quot;<br />
'&nbsp;&nbsp; Str = re.Replace(Str, &quot;$1scri&amp;#112;t&quot;)<br />
'&nbsp;re.Pattern = &quot;(j)(script)&quot;<br />
'&nbsp;&nbsp; Str = re.Replace(Str, &quot;$1scri&amp;#112;t&quot;)<br />
'&nbsp;re.Pattern = &quot;(vb)(script)&quot;<br />
'&nbsp;&nbsp; Str = re.Replace(Str, &quot;$1scri&amp;#112;t&quot;)</p>
</blockquote>
<p>&nbsp;修改后插入脚本的示例：</p>
<p><strong>QQ强制聊天代码脚本</strong></p>
<blockquote>
<p>&lt;script type=text/javascript&gt;<br />
function StartQQMSG()<br />
{<br />
&nbsp;&nbsp;&nbsp; var QNUM=document.getElementById('QQNum').value;<br />
&nbsp;&nbsp;&nbsp; if(QNUM==&quot;&quot;){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert(&quot;请输入QQ号码&quot;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.getElementById('QQNum').focus();<br />
&nbsp;&nbsp;&nbsp; }else{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.getElementById('QHTML').innerHTML='&lt;a target=&quot;blank&quot; href=&quot;tencent://message/?Menu=yes&amp;uin='+QNUM+'&amp;Service=300&amp;sigT=45a1e5847943b64c6ff3990f8a9e644d2b31356cb0b4ac6b24663a3c8dd0f8aa12a595b1714f9d45&quot;&gt;&lt;img border=&quot;0&quot; src=http://wpa.qq.com/pa?p=4:'+QNUM+':41 alt=&quot;点击这里给我发消息&quot; height=16 align=&quot;absmiddle&quot; /&gt;对话&lt;/a&gt;';<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; return false;<br />
}<br />
&lt;/script&gt;<br />
&lt;div style=&quot;border-right: #f3f3f3 1px dashed; padding-right: 10px; border-top: #f3f3f3 1px dashed; padding-left: 10px; padding-bottom: 10px; border-left: #f3f3f3 1px dashed; padding-top: 10px; border-bottom: #f3f3f3 1px dashed; height: 50px; text-align: center&quot;&gt;&lt;input class=&quot;qinput&quot; id=&quot;QQNum&quot; maxlength=&quot;10&quot; size=&quot;10&quot; type=&quot;text&quot; /&gt; &lt;input class=&quot;qsubmit&quot; type=&quot;button&quot; align=&quot;absMiddle&quot; onclick=&quot;StartQQMSG()&quot; value=&quot;QQ对话&quot; /&gt;&lt;span id=&quot;QHTML&quot;&gt;QQ在线&lt;/span&gt;&lt;/div&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;br/&gt;</p>
</blockquote>
<p>&nbsp;</p>]]></description>
		</item>
		
			<item>
			<link>http://www.zhiwenweb.cn/article.asp?id=1183</link>
			<title><![CDATA[复活我的dutory博客ASP.NET学习笔记]]></title>
			<author>lzwy0820@qq.com(任侠)</author>
			<category><![CDATA[网站建设]]></category>
			<pubDate>Tue,08 Jun 2010 14:30:54 +0800</pubDate>
			<guid>http://www.zhiwenweb.cn/default.asp?id=1183</guid>
		<description><![CDATA[<p>&nbsp;用z-blog的朋友是否记得dutory? 这个在z-blog论坛发布的ASP.NET博客程序，最开始发布时志文工作室就在关注，因为那时开始学习ASP.NET课程。当时用该程序建立了<a target="_blank" href="http://www.zhiwenweb.cn/aspx/default.aspx">ASP.NET学习笔记</a>博客，不过后来这门课程学习完了，也没怎么继续深入了。</p>
<p>去年准备考研的时候，博客就基本了停止更新，这个<a target="_blank" href="http://www.zhiwenweb.cn/aspx/">ASP.NET学习笔记</a>的博客也没有继续更新了。之后博客更换空间，由于新的USA空间开始不支持asp.net，就去掉了它。后来也因为时间的原因实际上放弃了ASP.NET的继续学习，也就一直没有管它了。</p>
<p>昨天在z-blog论坛转悠，再次看到Dutory的大名，兴致所致，就让它&ldquo;复活&rdquo;了。至于以后会怎么处理它，暂时还没想好，现在就先让它活着吧。</p>
<p>dutory的功能实际上确实挺不错的，只是技术支持开发过于&ldquo;低调&rdquo;，开发进度也很慢，以至于使用的人很少。我这个，暂且当做Dutory为数不多的博客给大家一个参考的例子吧</p>
<p>&nbsp;博客地址：<a href="http://www.zhiwenweb.cn/aspx/">http://www.zhiwenweb.cn/aspx/</a>&nbsp; ，有兴趣的可以去围观一下</p>]]></description>
		</item>
		
			<item>
			<link>http://www.zhiwenweb.cn/article.asp?id=1171</link>
			<title><![CDATA[pjblog修改评论留言楼层设置与评论审核状态关闭时评论审核状态通过]]></title>
			<author>lzwy0820@qq.com(任侠)</author>
			<category><![CDATA[网站建设]]></category>
			<pubDate>Sun,16 May 2010 22:58:39 +0800</pubDate>
			<guid>http://www.zhiwenweb.cn/default.asp?id=1171</guid>
		<description><![CDATA[<p>pjblog4一直处于难产状态中，虽然说是在内测组内，但从未获得一点有用的信息，所以不再保持高度的期待状态了，好好打点下pj352，也足够使用需求了。</p>
<p>下午进行了两处的功能修改，一个为：默认评论时，不管是否开启评论审核，评论审核状态一直默认为未审核，这样当打开审核时，原来显示的评论也看不到了。另一个为：为了互动性，设置评论留言者的楼层设置，一来方便查阅，二来增加互动性乐趣。</p>
<p>这里发布修改方法，一方面供自己备份查询，另一方面给同用352版本的pjer作为参考。其他pj版本可参考修改。<span style="color: #ff0000">此修改在半静态下进行。</span></p>
<p><strong>1、评论审核打开时，发表评论自动审核通过<br />
</strong>方法：<br />
打开文件blogcomm.asp，查找代码：<br />
&nbsp;</p>
<div style="border-right: #888 1px dashed; padding-right: 10px; border-top: #888 1px dashed; padding-left: 10px; background: rgb(255,255,153); padding-bottom: 10px; margin: 10px auto; border-left: #888 1px dashed; color: #f00; padding-top: 10px; border-bottom: #888 1px dashed">Post_WebSite = Trim(CheckStr(request.Form(&quot;WebSite&quot;)))</div>
<p>在其下面添加：<br />
&nbsp;</p>
<div style="border-right: #888 1px dashed; padding-right: 10px; border-top: #888 1px dashed; padding-left: 10px; background: rgb(255,255,153); padding-bottom: 10px; margin: 10px auto; border-left: #888 1px dashed; color: #f00; padding-top: 10px; border-bottom: #888 1px dashed">'评论非审核状态则自动审核通过所有评论<br />
&nbsp;dim Post_IsAudit<br />
&nbsp;If blog_AuditOpen Then Post_IsAudit=False Else Post_IsAudit=True</div>
<p>查找代码：<br />
&nbsp;</p>
<div style="border-right: #888 1px dashed; padding-right: 10px; border-top: #888 1px dashed; padding-left: 10px; background: rgb(255,255,153); padding-bottom: 10px; margin: 10px auto; border-left: #888 1px dashed; color: #f00; padding-top: 10px; border-bottom: #888 1px dashed">&nbsp;&nbsp;&nbsp; AddComm = Array(Array(&quot;blog_ID&quot;, post_logID), Array(&quot;comm_Content&quot;, post_Message), Array(&quot;comm_Author&quot;, username), Array(&quot;comm_DisSM&quot;, post_DisSM), Array(&quot;comm_DisUBB&quot;, post_DisUBB), Array(&quot;comm_DisIMG&quot;, post_disImg), Array(&quot;comm_AutoURL&quot;, post_DisURL), Array(&quot;comm_PostIP&quot;, getIP), Array(&quot;comm_AutoKEY&quot;, post_DisKEY),comm_IsAudit Array(&quot;comm_Email&quot;, Post_Email), Array(&quot;comm_WebSite&quot;, Post_WebSite))</div>
<p>修改为：</p>
<div style="border-right: #888 1px dashed; padding-right: 10px; border-top: #888 1px dashed; padding-left: 10px; background: rgb(255,255,153); padding-bottom: 10px; margin: 10px auto; border-left: #888 1px dashed; color: #f00; padding-top: 10px; border-bottom: #888 1px dashed">&nbsp;&nbsp;&nbsp; AddComm = Array(Array(&quot;blog_ID&quot;, post_logID), Array(&quot;comm_Content&quot;, post_Message), Array(&quot;comm_Author&quot;, username), Array(&quot;comm_DisSM&quot;, post_DisSM), Array(&quot;comm_DisUBB&quot;, post_DisUBB), Array(&quot;comm_DisIMG&quot;, post_disImg), Array(&quot;comm_AutoURL&quot;, post_DisURL), Array(&quot;comm_PostIP&quot;, getIP), Array(&quot;comm_AutoKEY&quot;, post_DisKEY), Array(&quot;comm_Email&quot;, Post_Email),comm_IsAudit Array(&quot;comm_Email&quot;, Post_Email), Array(&quot;comm_WebSite&quot;, Post_WebSite))</div>
<p><br />
<strong>2、设置楼层显示：占楼抢沙发设置</strong><br />
打开文件class/cls_article.asp,查找代码：</p>
<div style="border-right: #888 1px dashed; padding-right: 10px; border-top: #888 1px dashed; padding-left: 10px; background: rgb(255,255,153); padding-bottom: 10px; margin: 10px auto; border-left: #888 1px dashed; color: #f00; padding-top: 10px; border-bottom: #888 1px dashed">&nbsp;&nbsp;'顶部翻页</div>
<p>在其上面添加如下代码：<br />
&nbsp;</p>
<div style="border-right: #888 1px dashed; padding-right: 10px; border-top: #888 1px dashed; padding-left: 10px; background: rgb(255,255,153); padding-bottom: 10px; margin: 10px auto; border-left: #888 1px dashed; color: #f00; padding-top: 10px; border-bottom: #888 1px dashed">&nbsp;'抢沙发设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;Dim Lou_sum<br />
&nbsp;&nbsp;&nbsp; ' If log_ViewArr(6, 0) Then comDesc = &quot;Desc&quot; Else comDesc = &quot;Asc&quot; End If<br />
&nbsp;&nbsp;If comDesc=&quot;Desc&quot; Then Lou_sum=comm_Num Else Lou_sum=1<br />
&nbsp;&nbsp;If comDesc=&quot;Desc&quot; Then Lou_sum=Lou_sum-blogcommpage*(CurPage-1) Else Lou_sum=Lou_sum+blogcommpage*(CurPage-1)</div>
<p>查找代码：</p>
<div style="border-right: #888 1px dashed; padding-right: 10px; border-top: #888 1px dashed; padding-left: 10px; background: rgb(255,255,153); padding-bottom: 10px; margin: 10px auto; border-left: #888 1px dashed; color: #f00; padding-top: 10px; border-bottom: #888 1px dashed">&nbsp;&nbsp;&nbsp;Pcount = Pcount + 1</div>
<p>在其下面添加如下代码：<br />
&nbsp;</p>
<div style="border-right: #888 1px dashed; padding-right: 10px; border-top: #888 1px dashed; padding-left: 10px; background: rgb(255,255,153); padding-bottom: 10px; margin: 10px auto; border-left: #888 1px dashed; color: #f00; padding-top: 10px; border-bottom: #888 1px dashed">&nbsp;&nbsp;&nbsp;If comDesc=&quot;Desc&quot; Then Lou_sum=Lou_sum-1 Else Lou_sum=Lou_sum+1</div>
<p>查找代码：<br />
&nbsp;</p>
<div style="border-right: #888 1px dashed; padding-right: 10px; border-top: #888 1px dashed; padding-left: 10px; background: rgb(255,255,153); padding-bottom: 10px; margin: 10px auto; border-left: #888 1px dashed; color: #f00; padding-top: 10px; border-bottom: #888 1px dashed">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;ShowComm = ShowComm&amp;&quot;&lt;a name=&quot;&quot;comm_&quot;&amp;blog_CommID&amp;&quot;&quot;&quot; href=&quot;&quot;javascri&#112;t:addQuote('&quot;&amp;blog_CommAuthor&amp;&quot;','commcontent_&quot;&amp;blog_CommID&amp;&quot;')&quot;&quot;&gt;&lt;img border=&quot;&quot;0&quot;&quot; src=&quot;&quot;images/icon_quote.gif&quot;&quot; alt=&quot;&quot;&quot;&quot; style=&quot;&quot;margin:0px 4px -3px 0px&quot;&quot;/&gt;&lt;/a&gt;&quot;</div>
<p>修改为：</p>
<div style="border-right: #888 1px dashed; padding-right: 10px; border-top: #888 1px dashed; padding-left: 10px; background: rgb(255,255,153); padding-bottom: 10px; margin: 10px auto; border-left: #888 1px dashed; color: #f00; padding-top: 10px; border-bottom: #888 1px dashed">&nbsp;&nbsp;&nbsp;Dim Lou_show<br />
&nbsp;&nbsp;&nbsp;Select Case Lou_sum<br />
&nbsp;&nbsp;&nbsp;Case 1<br />
&nbsp;&nbsp;&nbsp;&nbsp;Lou_show=&quot;沙发&quot;<br />
&nbsp;&nbsp;&nbsp;Case 2<br />
&nbsp;&nbsp;&nbsp;&nbsp;Lou_show=&quot;板凳&quot;&nbsp; <br />
&nbsp;&nbsp;&nbsp;Case 3<br />
&nbsp;&nbsp;&nbsp;&nbsp;Lou_show=&quot;地板&quot;<br />
&nbsp;&nbsp;&nbsp;Case Else&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;Lou_show=Lou_sum&amp;&quot;楼&quot; <br />
&nbsp;&nbsp;&nbsp;End Select<br />
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;ShowComm = ShowComm&amp;&quot;&lt;span style=&quot;&quot;float:right;cursor:pointer&quot;&quot;&gt;&lt;a name=&quot;&quot;comm_&quot;&amp;blog_CommID&amp;&quot;&quot;&quot; href=&quot;&quot;javascri&#112;t:addQuote('&quot;&amp;blog_CommAuthor&amp;&quot;','commcontent_&quot;&amp;blog_CommID&amp;&quot;')&quot;&quot;&gt;&lt;img border=&quot;&quot;0&quot;&quot; src=&quot;&quot;images/icon_quote.gif&quot;&quot; alt=&quot;&quot;回复引用该发言&quot;&quot; style=&quot;&quot;margin:0px 4px -3px 0px&quot;&quot;/&gt;引用该留言&lt;/a&gt; &quot;&amp;Lou_show&amp;&quot;&lt;/span&gt;&quot;</div>]]></description>
		</item>
		
			<item>
			<link>http://www.zhiwenweb.cn/article.asp?id=1157</link>
			<title><![CDATA[124.115.0的IP段访问频繁造成网站空间负载过荷：限制搜搜蜘蛛抓取频率的参考方法]]></title>
			<author>lzwy0820@qq.com(任侠)</author>
			<category><![CDATA[网站建设]]></category>
			<pubDate>Thu,29 Apr 2010 22:13:40 +0800</pubDate>
			<guid>http://www.zhiwenweb.cn/default.asp?id=1157</guid>
		<description><![CDATA[近日来，很多站长都反映，124.115.0段的IP大量出现在网站LOG记录中，访问次数非常频繁，造成网站服务器CPU使用率上升，消耗大量资源。志文工作室同样受此IP段访问的干扰，以至于有限的空间总是资源紧张网站打开速度明显减慢。<br/>根据IP地址查询得知，此IP是陕西省 西安市(电信机房) 电信，并非百度、谷歌等搜索引擎的蜘蛛爬虫。该IP段一般被日志记录为普通用户访问，多数站长认为是采集器、群发软件等，纷纷将此IP禁止访问。<br/>其实据查这个IP段是腾讯SOSO的爬虫。目前SOSO新闻使用的IP是124.115.1段，与124.115.0段是同一个机房。大家都知道，以前用搜搜的时候都会提示搜索结果来自谷歌，这是因为搜搜的搜索技术来自于谷歌。但是自2009年9月李开复从谷歌辞职时，腾讯搜搜与谷歌的合作即已经到期，搜搜正式推出了自己的独立搜索引擎。<br/>上面提到的这个IP段正是SOSO现在爬取页面的服务器群。<br/>据观察统计该IP段地址列表为：<br/><div class="UBBPanel quotePanel"><div class="UBBTitle"><img src="http://www.zhiwenweb.cn/images/quote.gif" style="margin:0px 2px -3px 0px" alt="引用内容"/> 引用内容</div><div class="UBBContent">124.115.0.14<br/>124.115.0.15<br/>124.115.0.16<br/>124.115.0.17<br/>124.115.0.18<br/>124.115.0.19<br/>124.115.0.20<br/>124.115.0.21<br/>124.115.0.22<br/>124.115.0.23<br/>124.115.0.24<br/>124.115.0.25<br/>124.115.0.26<br/>124.115.0.27<br/>124.115.0.100<br/>124.115.0.101<br/>124.115.0.102<br/>124.115.0.103<br/>124.115.0.104<br/>124.115.0.105<br/>124.115.0.106<br/>124.115.0.107<br/>124.115.0.108<br/>124.115.0.109<br/>124.115.0.110<br/>124.115.0.111<br/>124.115.0.138<br/>124.115.0.139<br/>124.115.0.140<br/>124.115.0.141<br/>124.115.0.142<br/>124.115.0.156<br/>124.115.0.157<br/>124.115.0.158<br/>124.115.0.159<br/>124.115.0.160<br/>124.115.0.161<br/>124.115.0.162<br/>124.115.0.163<br/>124.115.0.164<br/>124.115.0.165<br/>124.115.0.166<br/>124.115.0.167<br/>124.115.0.168<br/>124.115.0.169<br/>124.115.0.170<br/>124.115.0.171</div></div><br/>如果你的网站访问量小，空间（或服务器）能够承受的住，那么，你大可不必担心，蜘蛛抓取页面当然是站长们希望的。但是如果这种抓取确实是影响到了站点的正常运行，你就不得不采取点措施了。下面让志文工作室来帮助你分析一些可行的参考解决方案。<br/>我们知道使用Google 网站管理员工具可以诊断和管理Googlebot 抓取网站的频率，这是SEO搜索引擎优化人员要了解和关注的，善用之将取得事半功倍的效果。但是对于其他搜索引擎的蜘蛛，我们可以怎么办呢？<br/>一种方法是，如许多站长那样，在管理后台限制该IP段的访问，不过你可能又害怕这样会使站点的页面收录受到太大的影响，这样你可以尝试只限制统计到的IP中的一部分。<br/>另一种方法是，你可以通过给腾讯Soso发过邮件要求降低搜搜蜘蛛的访量，其客服邮件地址为：sosospider@tencent.com。据说这样做是能够得到有效的回复的。<br/>当然或许你很在意去发这样的邮件，那么还有其他办法，就是通过书写robots.txt进行限制和引导搜搜的蜘蛛sosospider。<br/>比如你可以这样书写来控制蜘蛛抓取频率：<br/>User-agent:*<br/>Crawl-delay:400<br/>意思为控制大概每400秒抓取一次。实际上同时抓取的不同服务器IP段蜘蛛很多，所以事实上抓取频率是少于400秒的，具体设置为多少，你可以根据自己站点的实际情况考虑。但是并不是所有的搜索引擎均支持Crawl-delay属性。此外，合适的书写robots.txt来控制蜘蛛的抓取，但书写robot也有一定的技巧，如果你对如何书写robots不太了解，可以参考下面这篇文章，这里介绍的很详细：<br/>网站针对搜索引擎收录控制设置：robots.txt和Robots META标签应用详解 <br/><a href="http://www.zhiwenweb.cn/default.asp?id=1088" target="_blank" rel="external">http://www.zhiwenweb.cn/default.asp?id=1088</a>]]></description>
		</item>
		
			<item>
			<link>http://www.zhiwenweb.cn/article.asp?id=1156</link>
			<title><![CDATA[IIS端口占用无法启动：启用IIS发生意外错误0x8ffe2740的原因及参考解决方案]]></title>
			<author>lzwy0820@qq.com(任侠)</author>
			<category><![CDATA[网站建设]]></category>
			<pubDate>Thu,29 Apr 2010 11:36:46 +0800</pubDate>
			<guid>http://www.zhiwenweb.cn/default.asp?id=1156</guid>
		<description><![CDATA[一般你不常在电脑上用IIS测试网站，或许你会选择将与之相关的两个服务设置为手动启动，以此节省宝贵的内存资源。但是，当你在Internet信息服务里打算启用IIS时，却发现弹出对话框错误提示：<br/><span style="color:Blue">启用IIS发生意外错0x8ffe2740</span><br/>这是是不是很郁闷呢？志文工作室最近就遇到了类似的问题，下面列举下相关的问题原因以供参考。<br/><strong>原因 </strong><br/>如果系统中存在端口冲突就有可能发生本情况. IIS默认使用80端口进行HTTP通信. 如果除IIS外的应用程序正在运行并且正在相同的IP地址上使用80端口,在您试图使用IIS管理器启动网站时您也可能收到该错误讯息。<br/><strong>解决方法 </strong><br/>要解决这个问题,您可以进行以下任一项操作: <br/> 在IIS管理器中更改网站绑定端口为除80端口外的其它端口。具体操作方法：IIS默认网站-点击右键属性-把tcp端口改成其他数字就可。<br/> 停止正在使用80端口的应用程序,然后从IIS管理器中启动网站。如果你正在用迅雷软件，可以查一下，在迅雷的工具-配置-BT/端口设置里查看，如果TCP端口为80（默认为80），改为其它的数字，即可防止以后再因为使用迅雷而发生此类情况。当然也可能是其他程序占用了80端口，所以如果你不确定为何程序，可按照方法一来操作解决。<br/>]]></description>
		</item>
		
			<item>
			<link>http://www.zhiwenweb.cn/article.asp?id=1154</link>
			<title><![CDATA[replace函数：批量替换数据库中指定字段内指定字符串参考方法]]></title>
			<author>lzwy0820@qq.com(任侠)</author>
			<category><![CDATA[网站建设]]></category>
			<pubDate>Wed,28 Apr 2010 09:38:59 +0800</pubDate>
			<guid>http://www.zhiwenweb.cn/default.asp?id=1154</guid>
		<description><![CDATA[<strong>语法</strong><br/>REPLACE ( &#39;string_e­xpression1&#39; , &#39;string_e­xpression2&#39; , &#39;string_e­xpression3&#39; )<br/><strong>参数说明</strong><br/>&#39;string_e­xpression1&#39;<br/>待搜索的字符串表达式。string_e­xpression1 可以是字符数据或二进制数据。<br/>&#39;string_e­xpression2&#39;<br/>待查找的字符串表达式。string_e­xpression2 可以是字符数据或二进制数据。<br/>&#39;string_e­xpression3&#39;<br/>替换用的字符串表达式。string_e­xpression3 可以是字符数据或二进制数据。<br/><br/>通俗理解即格式为：<br/>Up&#100;ate 表名 SET 要替换的列=REPLACE(要替换的列,被替换的字符,替换后的字符) <br/>示例SQL语句：<br/>Up&#100;ate tableName SET columeName = REPLACE(columeName, &#39;a&#39;, &#39;b&#39;)<br/><br/>但是值得注意的一点是，SQL Server有 replace函数，可以直接使用；Access数据库的replace函数只能在Access环境下用，不能用在Jet SQL中,所以对ASP没用，在ASP中调用该函数会提示错误：表达式中 &#39;REPLACE&#39; 函数未定义。在Asp中可以写一个函数实现该功能。<br/><strong>示例函数：</strong>&nbsp;&nbsp; <br/>function&nbsp;&nbsp; replace(title)&nbsp;&nbsp; <br/>{&nbsp;&nbsp; <br/>&nbsp;&nbsp;replace(title,&#39;aaa&#39;,&#39;bbbb&#39;)&nbsp;&nbsp; <br/>&nbsp;&nbsp;return(title)&nbsp;&nbsp; <br/>}&nbsp;&nbsp; <br/>&nbsp;&nbsp;bbb=replace(title)&nbsp;&nbsp; <br/>&nbsp;&nbsp;up&#100;ate&nbsp;&nbsp; .....&nbsp;&nbsp; set&nbsp;&nbsp; title=&#39;&#34;&amp;bbb&amp;&#34;&#39; <br/><br/><strong>ASP+access批量替换指定字符参考代码：</strong><br/>&lt;%<br/>Set Conn&nbsp;&nbsp; = Server.Cr&#101;ateObject(&#34;ADODB.Connection&#34;)<br/>Conn.Open&nbsp;&nbsp;&#34;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&#34; &amp; Server.MapPath(&#34;数据库名.mdb&#34;)<br/>Set rs = Server.Cr&#101;ateobject(&#34;ADODB.Recordset&#34;)<br/>sql=&#34;Sel&#101;ct * from [表名]&#34;<br/>rs.open sql,conn,1,3<br/>while not rs.eof<br/>&nbsp;&nbsp;&nbsp;&nbsp;rs(&#34;字段名&#34;)=replace(rs(&#34;字段名&#34;),&#34;被替换的字符&#34;,&#34;替换为的字符&#34;)<br/>&nbsp;&nbsp;&nbsp;&nbsp;rs.up&#100;ate<br/>&nbsp;&nbsp;&nbsp;&nbsp;rs.movenext<br/>wend<br/>rs.close<br/>set rs=nothing<br/>conn.close<br/>set conn=nothing<br/>%&gt; ]]></description>
		</item>
		
			<item>
			<link>http://www.zhiwenweb.cn/article.asp?id=1149</link>
			<title><![CDATA[CSS学习进阶：一些CSS设计的实用小技巧参考]]></title>
			<author>lzwy0820@qq.com(任侠)</author>
			<category><![CDATA[网站建设]]></category>
			<pubDate>Thu,22 Apr 2010 16:40:29 +0800</pubDate>
			<guid>http://www.zhiwenweb.cn/default.asp?id=1149</guid>
		<description><![CDATA[进阶学习和练习中，一些细小的地方慢慢地变的清晰简洁起来。进步，是时间和经验的累积。<br/><br/><strong>css3的圆角示例：</strong><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code20718);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code20718>.element {&nbsp;&nbsp; <br/>.rounded{<br/>&nbsp;&nbsp;&nbsp;&nbsp;-moz-border-radius: 5px; /* Firefox */<br/>&nbsp;&nbsp;&nbsp;&nbsp;-webkit-border-radius: 5px; /* Safari */<br/>&nbsp;&nbsp;&nbsp;&nbsp; border-radius: 5px; /* future proofing */&nbsp;&nbsp; <br/>}&nbsp;&nbsp; <br/>.element-top-left-corner {&nbsp;&nbsp; <br/> -moz-border-radius-topleft: 5px;&nbsp;&nbsp; <br/> -webkit-border-top-left-radius: 5px;&nbsp;&nbsp; <br/>}&nbsp;&nbsp; </div></div><br/><br/><strong>圆角的做法</strong><br/>大体的编写方式便是如下.<br/>好处是便于维护,只有一个图片.还可以某种程度上的任意缩放.缺点是多了无意义的html代码.<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code12432);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code12432>css：<br/>.c,.c i,.c i i,.c b,.c b b,.c p{background-image:url(<a href="http://pics.taobao.com/bao/album/promotion/uiblog/purple.png" target="_blank" rel="external">http://pics.taobao.com/bao/album/promotion/uiblog/purple.png</a>);/*背景图片*/background-repeat:no-repeat;}<br/>.c{width:200px;/*临时定的宽度*/background-position:0 -4px;}<br/>.c i{display:block;height:4px;}<br/>.c i i{margin:0 0 0 4px;background-position:right 0;}<br/>.c b{display:block;height:4px;background-position:0 bottom;}<br/>.c b b{margin:0 0 0 4px;background-position:right bottom;}<br/>.c p{margin:0 0 0 4px;padding:0 4px 0 0;background-position:right -4px;}<br/><br/>html：<br/>&lt; div class=&#34;c&#34;&gt;&lt; i&gt;&lt; i&gt;&lt; /i&gt;&lt; /i&gt;&lt; p&gt;按钮按钮按钮按钮按钮按钮按按按按按钮按钮按钮按钮按钮按钮按钮按钮按钮按钮按钮按钮&lt; /p&gt;&lt; b&gt;&lt; b&gt;&lt; /b&gt;&lt; /b&gt;&lt; /div&gt;</div></div><br/><br/><strong>table的全局定义</strong><br/>caption这个标签在firefox下会有左边有1px空隙的bug,很讨厌.能想到的简单的方法只有-1px的margin了.<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code90405);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code90405>css：<br/>table{<br/>border-collapse:collapse;<br/>}<br/>table caption,table td,table th{<br/>border:1px solid #a2bbdd;/*边框颜色*/<br/>background:#c3d9ff;/*背景颜色*/<br/>}<br/>table caption{<br/>text-align:left;<br/>border-bottom:none;<br/>margin-left:-1px;<br/>}<br/><br/>html：<br/>&lt; table&gt;<br/>&lt; caption&gt;表格标题&lt; /caption&gt;<br/>&lt; tr&gt;<br/>&lt; th&gt;标题&lt; /th&gt;<br/>&lt; th&gt;标题&lt; /th&gt;<br/>&lt; th&gt;标题&lt; /th&gt;<br/>&lt; th&gt;标题&lt; /th&gt;<br/>&lt; /tr&gt;<br/>&lt; tr&gt;<br/>&lt; td&gt; 内容&lt; /td&gt;<br/>&lt; td&gt; 内容&lt; /td&gt;<br/>&lt; td&gt; 内容&lt; /td&gt;<br/>&lt; td&gt; 内容&lt; /td&gt;<br/>&lt; /tr&gt;<br/>&lt; /table&gt;</div></div><br/><br/><strong>未知图片的垂直居中</strong><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code29926);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code29926>CSS:<br/> .tb-p-c{&nbsp;&nbsp;display: table-cell;&nbsp;&nbsp;vertical-align:middle;&nbsp;&nbsp;width:140px;&nbsp;&nbsp;height:140px;&nbsp;&nbsp;text-align:center;&nbsp;&nbsp;*display: block;&nbsp;&nbsp;*font-size: 122px;&nbsp;&nbsp;background:red;}.tb-p-c img {&nbsp;&nbsp;vertical-align:middle;} <br/><br/>HTML:<br/>&lt;a class=&#34;tb-p-c&#34;&gt;&lt;img src=&#34;jishi070912_2.jpg&#34; /&gt;&lt;/a&gt; </div></div><br/><br/><strong>跨浏览器的CSS透明度设计：</strong><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code11363);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code11363>.transparent {&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;/* Modern Browsers */ opacity: 0.7;&nbsp;&nbsp; <br/>&nbsp;&nbsp;/* IE 8 */ -ms-filter: &#34;progid:DXImageTransform.Microsoft.Alpha(Opacity=70)&#34;;&nbsp;&nbsp; <br/>&nbsp;&nbsp;/* IE 5-7 */ filter: alpha(opacity=70);&nbsp;&nbsp; <br/>&nbsp;&nbsp;/* Netscape */ -moz-opacity: 0.7; <br/>&nbsp;&nbsp;/* Safari 1 */ -khtml-opacity: 0.7;&nbsp;&nbsp;<br/>} </div></div><br/><br/><strong>CSS3的文字阴影：</strong><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code93610);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code93610>.text { text-shadow: 1px 1px 1px #666; filter: Shadow(Color=#666666, Direction=135, Strength=5); }&nbsp;&nbsp;</div></div><br/><br/><strong>CSS3的盒子阴影：</strong><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code20313);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code20313>.box { box-shadow: 5px 5px 5px #666;&nbsp;&nbsp;-moz-box-shadow: 5px 5px 5px #666;&nbsp;&nbsp;-webkit-box-shadow: 5px 5px 5px #666; }&nbsp;&nbsp; </div></div><br/><br/><strong>兼容的最小高度全兼容写法：</strong><br/>Min-height是个很有用的属性，但并非所有浏览器都兼容的，当然主要问题出在IE6，这个不支持标准的浏览器偏偏占据很大的市场份额，实在让设计师无奈。好在IE6对于overflow的特殊实现，又给我们实现Min-height提供了一个思路，所以产生了以下兼容各个主流浏览器的Min-height写法：<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code40203);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code40203>.element { min-height:600px; height:auto !important; height:600px;overflow:visible;}&nbsp;&nbsp;</div></div><br/><br/><strong>页面的最小宽度：</strong><br/>min-width是个非常方便的CSS命令，它可以指定元素最小也不能小于某个宽度，这样就能保证排版一直正确。但IE不认得这个，而它实际上把width当做最小宽度来使。为了让这一命令在IE上也能用，可以把一个&lt;div&gt; 放到 &lt;body&gt; 标签下，然后为div指定一个类，然后CSS这样设计：<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code7091);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code7091>#container{ min-width: 600px; width:e­xpression(document.body.clientWidth &lt; 600? &#34;600px&#34;: &#34;auto&#34; );}</div></div><br/>第一个min-width是正常的；但第2行的width使用了Javascri&#112;t，这只有IE才认得，这也会让你的HTML文档不太正规。它实际上通过Javascri&#112;t的判断来实现最小宽度。<br/><br/><strong>万能 float 闭合</strong><br/>将以下代码加入CSS文件中,给需要闭合的div加上 class=&#34;clearfix&#34; 即可<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code6427);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code6427>/* Clear Fix */<br/>.clearfix:after<br/>{<br/>content:&#34;.&#34;;<br/>display:block;<br/>height:0;<br/>clear:both;<br/>visibility:hidden;<br/>}<br/>.clearfix<br/>{<br/>display:inline-block;<br/>}<br/>/* Hide from IE Mac */<br/>.clearfix {display:block;}<br/>/* End hide from IE Mac */<br/>/* end of clearfix */</div></div><br/><br/><strong> 清除浮动：</strong><br/>.hackbox{ display:table; //将对象作为块元素级的表格显示}<br/>或者<br/>.hackbox{ clear:both;}<br/>或者加入:after（伪对象）,设置在对象后发生的内容，通常和content配合使用，IE不支持此伪对象，非Ie 浏览器支持，所以并不影响到IE/WIN浏览器。这种最麻烦的<br/>#box:after{ content: &#34;.&#34;; display: block; height: 0; clear: both; visibility: hidden;} <br/><br/><strong>DIV浮动IE文本产生3象素的bug</strong><br/>左边对象浮动，右边采用外补丁的左边距来定位，右边对象内的文本会离左边有3px的间距.<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code81860);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code81860>#box{ float:left; width:800px;}#left{ float:left; width:50%;}<br/>#right{ width:50%;}<br/>*html #left{ margin-right:-3px; //这句是关键}</div></div><br/>HTML代码：<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code55561);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code55561>&lt;div id=&#34;box&#34;&gt;&lt;div id=&#34;left&#34;&gt;&lt;/div&gt; &lt;div id=&#34;right&#34;&gt;&lt;/div&gt;&lt;/div&gt;</div></div><br/><br/><strong>属性选择器(这个不能算是兼容,是隐藏css的一个bug)</strong><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code7900);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code7900>p[id]{}div[id]{}</div></div><br/>这个对于IE6.0和IE6.0以下的版本都隐藏,FF和OPera作用<br/>属性选择器和子选择器还是有区别的,子选择器的范围从形式来说缩小了,属性选择器的范围比较大,如p[id]中,所有p标签中有id的都是同样式的.<br/><br/><strong>IE捉迷藏：</strong><br/>当div应用复杂的时候每个栏中又有一些链接，DIV等这个时候容易发生捉迷藏的问题。<br/>有些内容显示不出来，当鼠标选择这个区域时发现内容确实是在页面的。<br/>解决办法：对#layout使用line-height属性，或者给#layout使用固定高和宽；页面结构尽量简单。<br/><br/><strong>高度不适应：</strong><br/>高度不适应是当内层对象的高度发生变化时，外层高度不能自动进行调节，特别是当内层对象使用margin 或paddign 时。<br/>例：<br/><div class="UBBPanel quotePanel"><div class="UBBTitle"><img src="http://www.zhiwenweb.cn/images/quote.gif" style="margin:0px 2px -3px 0px" alt="引用内容"/> 引用内容</div><div class="UBBContent">&lt;div id=&#34;box&#34;&gt; <br/>&lt;p&gt;p对象中的内容&lt;/p&gt; <br/>&lt;/div&gt; <br/>CSS：#box {background-color:#eee; } <br/>#box p {margin-top: 20px;margin-bottom: 20px; text-align:center; }</div></div><br/>解决方法：在P对象上下各加2个空的div对象CSS代码：.1{height:0px;overflow:hidden;}，或者为DIV加上border属性。<br/><br/><strong>针对firefox ie6 ie7的css样式Hack方法：</strong><br/>现在大部分都是用!important来hack，对于ie6和firefox测试可以正常显示，但是ie7对!important可以正确解释，会导致页面没按要求显示！找到一个针对IE7不错的hack方式，就是使用“*+html”。<br/>*+html 与 *html 是IE特有的标签, firefox 暂不支持.而*+html 又为 IE7特有标签。<br/>现在可以这样写一个CSS： <br/><div class="UBBPanel quotePanel"><div class="UBBTitle"><img src="http://www.zhiwenweb.cn/images/quote.gif" style="margin:0px 2px -3px 0px" alt="引用内容"/> 引用内容</div><div class="UBBContent">#1 { color: #333; } /* Moz */ <br/>* html #1 { color: #666; } /* IE6 */ <br/>*+html #1 { color: #999; } /* IE7 */ </div></div><br/>那么在firefox下字体颜色显示为#333，IE6下字体颜色显示为#666，IE7下字体颜色显示为#999。<br/>注意:<br/>*+html 对IE7的HACK 必须保证HTML顶部有如下声明：<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code50884);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code50884>&lt;!DOCTYPE HTML PUBLIC &#34;-//W3C//DTD HTML 4.01 Transitional//EN&#34;　&#34;<a href="http://www.w3.org/TR/html4/loose.dtd" target="_blank" rel="external">http://www.w3.org/TR/html4/loose.dtd</a>&#34;&gt;</div></div><br/><strong>关于居中</strong><br/>垂直居中： 将 line-height 设置为 当前 div 相同的高度, 再通过 vertical-align: middle.( 注意内容不要换行.)<br/>水平居中： margin: 0 auto;<br/><br/><strong>截字省略号:</strong><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code75047);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code75047>sel&#101;ct { -o-text-overflow:ellipsis; text-overflow:ellipsis; white-space:nowrap; overflow:hidden; }</div></div><br/>这个是在越出长度后会自行的截掉多出部分的文字，并以省略号结尾，很好的一个技术。只是目前Firefox并不支持。<br/><br/><strong>只有Opera识别</strong><br/><div class="UBBPanel quotePanel"><div class="UBBTitle"><img src="http://www.zhiwenweb.cn/images/quote.gif" style="margin:0px 2px -3px 0px" alt="引用内容"/> 引用内容</div><div class="UBBContent">@media all and (min-width: 0px){ sel&#101;ct {……} }<br/>针对Opera浏览器做单独的设定。</div></div><br/><br/><strong>IE的if条件Hack</strong><br/><div class="UBBPanel quotePanel"><div class="UBBTitle"><img src="http://www.zhiwenweb.cn/images/quote.gif" style="margin:0px 2px -3px 0px" alt="引用内容"/> 引用内容</div><div class="UBBContent">&lt;!--[if IE]&gt; Only IE &lt;![endif]--&gt;<br/>所有的IE可识别<br/>&lt;!--[if IE 5.0]&gt; Only IE 5.0 &lt;![endif]--&gt;<br/>只有IE5.0可以识别<br/>&lt;!--[if gt IE 5.0]&gt; Only IE 5.0+ &lt;![endif]--&gt;<br/>IE5.0包换IE5.5都可以识别<br/>&lt;!--[if lt IE 6]&gt; Only IE 6- &lt;![endif]--&gt;<br/>仅IE6可识别<br/>&lt;!--[if gte IE 6]&gt; Only IE 6/+ &lt;![endif]--&gt;<br/>IE6以及IE6以下的IE5.x都可识别<br/>&lt;!--[if lte IE 7]&gt; Only IE 7/- &lt;![endif]--&gt;<br/>仅IE7可识别</div></div><br/><br/><strong>不会改变布局的图片滚动边框</strong><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code2559);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code2559>#example-one a img, #example-one a {<br/>&nbsp;&nbsp;&nbsp;&nbsp;border: none;<br/>&nbsp;&nbsp;&nbsp;&nbsp;overflow: hidden;<br/>&nbsp;&nbsp;&nbsp;&nbsp;float: left;<br/>}<br/>#example-one a:hover {<br/>&nbsp;&nbsp;&nbsp;&nbsp;border: 3px solid black;<br/>}<br/>#example-one a:hover img {<br/>&nbsp;&nbsp;&nbsp;&nbsp;margin: -3px;<br/>}</div></div><br/><br/><strong>跨浏览器的纯CSS提示</strong><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.zhiwenweb.cn/images/html.gif" style="margin:0px 2px -3px 0px"> HTML代码</div><div class="UBBContent"><TEXTAREA rows="8" id="temp73315">
<style type=&#34;text/css&#34;>
a:hover {
    background:#ffffff;
    text-decoration:none;} /***** 背景色对IE6来说是必须的 ****/
 
a.tooltip span {
    display:none;
    padding:2px 3px;
    margin-left:8px;
    width:130px;
}
 
a.tooltip:hover span{
    display:inline;
    position:absolute;
    background:#ffffff;
    border:1px solid #cccccc;
    color:#6c6c6c;
}
</style> 
Easy <a class=&#34;tooltip&#34; href=&#34;#&#34;>Tooltip<span>This is the crazy little Easy Tooltip Text.</span></a>.
</TEXTAREA><br/><INPUT onclick="runEx('temp73315')"  type="button" class="userbutton" value="运行此代码"/> <INPUT onclick="doCopy('temp73315')"  type="button" class="userbutton" value="复制此代码"/> <INPUT onclick="saveCode('temp73315')" type="button" class="userbutton" value="保存此代码"><br/> [Ctrl+A 全部选择 提示：你可先修改部分代码，再按运行]</div></div><br/><br/><strong>为选中的文本设置颜色(尽支持Firefox/Safari)</strong><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code66906);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code66906>::sel&#101;ction {<br/>&nbsp;&nbsp;&nbsp;&nbsp;background: #ffb7b7; /* Safari */<br/>}<br/>::-moz-sel&#101;ction {<br/>&nbsp;&nbsp;&nbsp;&nbsp;background: #ffb7b7; /* Firefox */<br/>}</div></div><br/><br/><strong>在链接后面添加一个文件类型图标</strong><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code423);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code423>a[href^=&#34;<a href="http://" target="_blank" rel="external">http://</a>&#34;] {<br/>&nbsp;&nbsp;&nbsp;&nbsp;background:transparent url(../images/external.png) center right no-repeat;<br/>&nbsp;&nbsp;&nbsp;&nbsp;display:inline-block;<br/>&nbsp;&nbsp;&nbsp;&nbsp;padding-right:15px;<br/>}</div></div><br/><br/><strong>css代码的简写</strong><br/>css缩写的语法，对新手有一定帮助<br/>* 0px不需要单位，直接:margin:0 <br/>* 盒模型的缩写，语法是margin:上 右 下 左;.甚至可以简写成margin:上 (右左) 下,当然右左的值应该是* 一样的 <br/>* css属性的最后一项”;”号省略。（不建议 ^_^） <br/>* 字体宽度normal用400代替,bold用700代替。 <br/>* 16进制的色彩值，如果每两位的值相同，可以缩写一半，例如：#000000可以缩写为#000;#0044DD* 可以缩写为#04D; <br/>* border边框的缩写，语法是border:width style color,类似boder:1px solid red; <br/>* 背景background的缩写,语法是color image repeat attachment position.类似:background:#f00 url(background.gif) no-repeat fixed 0 0( 为什么我从不写fixed呢?) <br/>字体的缩写,类似font:italic small-caps bold 1em/140% “SimSun”,sans-serif,可以省略到最简单font:12px “SimSun”. <br/>* list的属性缩写,语法list-style:square inside url(image.gif) ,不过一般咱们都不用. <br/><br/><strong>其他几点应该注意的地方：</strong><br/>* FF 和 IE 对 BOX 理解的差异导致相差 2px 的还有设为 float的div在ie下 margin加倍等问题；<br/>* ul 标签在 FF 下面默认有 list-style 和 padding . 最好事先声明, 以避免不必要的麻烦. (常见于导航标签和内容列表)；<br/>* 作为外部 wrapper 的 div 不要定死高度, 最好还加上 overflow: hidden.以达到高度自适应；<br/>* 关于手形光标. cursor: pointer. 而hand 只适用于 IE;<br/>* Firefox和IE7都支持td的:hover（但IE7要支持td:hover必须正确设置Doctype设置成xhtml1.0 trantional即可，如果没有设置Doctype，将会和IE6一样，不支持td:hover);<br/>* 确保在单词之间的空白处不换行，则在a,a:visited的样式中增加css规则：white-space:nowrap;<br/>* 在IE6中，虽然链接设置成块级元素，但是仍然只有在鼠标指针经过文字，才能触发鼠标经过效果，而不是进入矩形区域，就可以触发。在IE7中已经修正了这个bug，解决IE6的这个bug只需在a中增加一条css规则：height:1em;<br/>* &lt;script language=”javascri&#112;t”&gt;……&lt;/script&gt; 不能通过w3c<br/>&nbsp;&nbsp; &lt;script type=”text/javascri&#112;t”&gt;……&lt;/script&gt; 能通过w3c]]></description>
		</item>
		
			<item>
			<link>http://www.zhiwenweb.cn/article.asp?id=1147</link>
			<title><![CDATA[玉树地震国哀日，网站素装以示哀悼之情：兼容浏览器素装修改方法参考]]></title>
			<author>lzwy0820@qq.com(任侠)</author>
			<category><![CDATA[网站建设]]></category>
			<pubDate>Wed,21 Apr 2010 11:25:45 +0800</pubDate>
			<guid>http://www.zhiwenweb.cn/default.asp?id=1147</guid>
		<description><![CDATA[近年来国家多灾多难，祖国同胞们在面对这些自然灾害面前，只能以哀悼的方式表达我们的悼念之情，表达我们的友爱和团结。<br/>国哀日里，很多站长都自觉的挂起了网站素装，以自己的方式表达我们的情感。<br/>但是，很多站长有点苦恼的是，网上流行的素装代码，只适合IE浏览器。那么，有什么简单点的方式，让所有浏览器均能显示这种效果呢？<br/>修改图片，对了，这确实是最简单也是唯一的方式，百度等大型网站都是这么做的。<br/>然而，站长们面对站点里众多的图片，依然感觉很难下手。其实，我们只需要实现站点的主题色调为灰白就行了。这样一来，需要修改的图片并不是很多。<br/>下面让志文工作室来给大家介绍一下，添加代码以及简单修改图片的方法，具体效果可参看志文工作室全站页面。<br/><br/>1、首先，可以在网站的css文件的底部，加入如下参考代码：<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code68440);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code68440>*{color:#555!important;border-color:#949494!important}<br/>body{background:#f5f5f5!important;}<br/>html{filter:gray}</div></div><br/>当然如果你要加在单独页面里，也可以这样加在页面的头部：<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code18238);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.zhiwenweb.cn/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code18238>&lt;style type=&#34;text/css&#34;&gt;<br/>*{color:#555!important;border-color:#949494!important}<br/>body{background:#f5f5f5!important;}<br/>html{filter:gray}<br/>&lt;/style&gt;</div></div><br/>以上代码是利用CSS的优先级!important方式，设置了网站所有文字颜色为#555灰色，所有显示的边框颜色为#949494灰色，并设置body页面的背景为#f5f5f5灰白色。同时设置了IE的灰色滤镜。<br/><br/>2、然后，简单修改图片的方法，用PS的图层调色来完成，非常快速简单，方法如下：<br/>Photoshop里打开需要处理的图片，选择： 图像 - 调整 - 色相/饱和度，然后将饱和度设置为-100（即滑动条拉到最左边），然后保存图片即可。<br/><br/>当然如果你处理的是PNG或GIF格式图片，也可以直接选择：文件 - 存储为web和设备所用格式，然后在“使用通道使颜色减低”里选择：grayscale，然后保存图片，彩色图片即变为了灰色。<br/><br/>其实这样来做，花费不了多少时间，一般的站点，十分钟内即可搞定。<br/>让我们以自己的方式，向玉树受灾同胞们哀悼祈福！]]></description>
		</item>
		
</channel>
</rss>
