<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title><![CDATA[我爱CSS]]></title>
<link>http://www.52css.com/</link>
<description><![CDATA[Web标准化 DivCSS教程]]></description>
<language>zh-cn</language>
<copyright><![CDATA[Copyright 2005 PBlog2 v2.4]]></copyright>
<webMaster><![CDATA[MrJin@52css.com(MrJin)]]></webMaster>
<generator>PBlog2 v2.4</generator> 
<image>
	<title>我爱CSS</title> 
	<url>http://www.52css.com/images/logos.gif</url> 
	<link>http://www.52css.com/</link> 
	<description>我爱CSS</description> 
</image>

			<item>
			<link>http://www.52css.com/default.asp?id=1196</link>
			<title><![CDATA[52CSS.com重新备案中… 如遇访问不畅 请谅解]]></title>
			<author>MrJin@52css.com(52css)</author>
			<category><![CDATA[Web标准]]></category>
			<pubDate>Fri,25 Mar 2011 00:41:36 +0800</pubDate>
			<guid>http://www.52css.com/default.asp?id=1196</guid>	
		<description><![CDATA[　<br/>　<br/>　<br/>　<br/>　<br/>　　郁闷的事情年年有，今年特别多。<br/>　　52CSS.com这个域名，在被MRJIN注册下来的时候，就已经备案了。<br/>　　所以一直没有办法备案，只能用原有的备案号。<br/><br/>　　惊人的发现，公元2011年3月24日，这个备案号被撤消了。<br/>　　所以，网站打不开了，MRJIN的QQ爆了。<br/>　　现如今，正在解决中，网站已转到香港的服务器上……<br/><br/>　　<strong>这段时间如果访问不稳定，打开慢，打不开等现象。<br/>　　请Q我：9l55o8。感谢您的理解与支持。</strong><br/><br/>　　52CSS有您更精彩~~~<br/>　　<br/>　　]]></description>
		</item>
		
			<item>
			<link>http://www.52css.com/default.asp?id=1195</link>
			<title><![CDATA[divcss布局及Web标准对网站优化和SEO方面的益处]]></title>
			<author>MrJin@52css.com(52css)</author>
			<category><![CDATA[Web标准]]></category>
			<pubDate>Wed,23 Feb 2011 23:37:00 +0800</pubDate>
			<guid>http://www.52css.com/default.asp?id=1195</guid>	
		<description><![CDATA[　　现在采用CSS+DIV建网站的朋友越来越多,我们今天就谈谈divcss布局及Web标准对网站优化和SEO方面的益处:<br/>　　一、用css+div,就要放弃以前表格排版的一些习惯,包括页面格式的一些习惯:1.以前用表格排版,一般都是用不规则的背景图片,跨单元格来做一些不规则的效果.css+div的特点就是格式和样式分开.2.css+div还是用块的行使排版比较好,页面简单,直观,不那么花哨.源码的结构也简单,页面执行效率高.3.尽量少使用div的嵌套,减少换行等冗余代码,提升网页的加载速度.<br/>　　二、Div+css的网站结构对seo网站优化起到的作用越来越明显.研究现在排名靠前的一些热门关键词网站,基本都是用div+css了,那么为什么DIV+CSS会对排名或者说是seo更加有利呢?<br/>　　1.&nbsp;采用这种结构后HTML页面里基本只有文字或图片信息,而样式则放在CSS里面,这样搜索爬虫就不会管CSS,只要采集HTML里的内容就可以了,大大提高爬虫的效率.<br/>　　2.采用这种结构往往关键词更集中,密度更高.<br/>　　3.DIV+CSS相对于table来说比较精简,而且基本不存在网上一直在说的&#34;表格嵌套&#34;的问题.<br/>　　4.符合W3C标准的网页在seo优化方面本身就有优势,更得搜索引擎蜘蛛的喜爱.&nbsp;<br/>]]></description>
		</item>
		
			<item>
			<link>http://www.52css.com/default.asp?id=1194</link>
			<title><![CDATA[经验之谈：CSS网页布局避免滥用DIV元素]]></title>
			<author>MrJin@52css.com(52css)</author>
			<category><![CDATA[Div+CSS教程]]></category>
			<pubDate>Fri,11 Feb 2011 21:48:31 +0800</pubDate>
			<guid>http://www.52css.com/default.asp?id=1194</guid>	
		<description><![CDATA[　　CSS网页布局应该避免滥用div元素一直是我们倡导的，以合适的HTML标签组织文档是CSS网页布局的基础。<br/>　　页面中div与span元素的使用是一个新问题，我们也容易过多的使用它们。必要及合理的使用div可以明显的增强文档的结构性。这也是52CSS.com一直提倡的。<br/>　　如果你审视你的HTML文档，发现有着很多的div与span，那你就得换一个眼光来看问题了，是不是存在滥用的情况？<br/>　　是不是还有更好的标记来替代它们？若h1可以更好的表示所标记的内容，那你就得放弃p或span来定义。<br/>　　或许这是一对矛盾，我们本身也较难把握该如何正确的使用它们，也或许我们根本就得不到一个明确的答案。<br/>　　但有一点需要阐明，我们应该使文档在逻辑上具有清晰的结构，而且更加容易应用样式。<br/>　　我们可以将div仅看着是一个容器，或者叫做文档的组成“部分”。<br/>　　我们使用太多的容器，并不是一个明智的模式。<br/>　　而恰到好处居于合理位置的容器，可以让整个文档显的很有条理。]]></description>
		</item>
		
			<item>
			<link>http://www.52css.com/default.asp?id=1193</link>
			<title><![CDATA[IE6绝对定位的bug及其解决办法]]></title>
			<author>MrJin@52css.com(52css)</author>
			<category><![CDATA[CSS布局实例]]></category>
			<pubDate>Mon,17 Jan 2011 21:17:36 +0800</pubDate>
			<guid>http://www.52css.com/default.asp?id=1193</guid>	
		<description><![CDATA[　　IE6绝对定位的bug及其解决办法。position:absolute定位在IE6下存在left和bottom的定位错误问题：<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">&lt;!–IE6下的left定位错误–&gt;<br/>&lt;div&nbsp;style=”position:relative;border:1px&nbsp;solid&nbsp;o&#114;ange;text-align:center;”&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a&nbsp;href=”<a href="http://www.52css.com" target="_blank">http://www.52css.com</a>”&gt;<a href="http://www.52css.com/" target="_blank">http://www.52css.com/</a>&lt;/a&gt;<br/>&lt;div&nbsp;style=”position:absolute;top:0;left:0;background:#CCC;”&gt;52CSS&lt;/div&gt;<br/>&lt;/div&gt;<br/>&lt;!–IE6下的left定位错误–&gt;<br/>&lt;hr&nbsp;/&gt;<br/>&lt;div&nbsp;style=”position:relative;border:1px&nbsp;solid&nbsp;o&#114;ange;text-align:right;”&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a&nbsp;href=”<a href="http://www.52css.com" target="_blank">http://www.52css.com</a>”&gt;<a href="http://www.52css.com/" target="_blank">http://www.52css.com/</a>&lt;/a&gt;<br/>&lt;div&nbsp;style=”position:absolute;top:0;left:0;background:#CCC;”&gt;52CSS&lt;/div&gt;<br/>&lt;/div&gt;</div></div><br/>　　上面这段代码在IE6中定位错误。<br/>　　解决办法有两种：<br/>　　1、给父层设置zoom:1触发layout。&nbsp;<br/>　　2、给父层设置宽度（width）。<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">&lt;!–解决方法1&nbsp;zoom:1–&gt;<br/>&lt;hr&nbsp;/&gt;<br/>&lt;div&nbsp;style=”position:relative;border:1px&nbsp;solid&nbsp;o&#114;ange;zoom:1;text-align:center;”&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a&nbsp;href=”<a href="http://www.52css.com" target="_blank">http://www.52css.com</a>”&gt;<a href="http://www.52css.com/" target="_blank">http://www.52css.com/</a>&lt;/a&gt;<br/>&lt;div&nbsp;style=”position:absolute;top:0;left:0;background:#CCC;”&gt;52CSS&lt;/div&gt;<br/>&lt;/div&gt;<br/>&lt;!–解决方法2&nbsp;设置width–&gt;<br/>&lt;hr&nbsp;/&gt;<br/>&lt;div&nbsp;style=”position:relative;width:99%;border:1px&nbsp;solid&nbsp;o&#114;ange;text-align:center;”&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a&nbsp;href=”<a href="http://www.52css.com" target="_blank">http://www.52css.com</a>”&gt;<a href="http://www.52css.com/" target="_blank">http://www.52css.com/</a>&lt;/a&gt;<br/>&lt;div&nbsp;style=”position:absolute;top:0;left:0;background:#CCC;”&gt;52CSS&lt;/div&gt;<br/>&lt;/div&gt;</div></div><br/>　　下面的这段代码在IE6下，bottom定位错误：<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">&lt;!–IE6下的bottom定位错误–&gt;<br/>&lt;hr&nbsp;/&gt;<br/>&lt;div&nbsp;style=”position:relative;border:1px&nbsp;solid&nbsp;o&#114;ange;text-align:center;”&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a&nbsp;href=”<a href="http://www.52css.com" target="_blank">http://www.52css.com</a>”&gt;<a href="http://www.52css.com/" target="_blank">http://www.52css.com/</a>&lt;/a&gt;<br/>&lt;div&nbsp;style=”position:absolute;bottom:0;left:0;background:#CCC;”&gt;52CSS&lt;/div&gt;<br/>&lt;/div&gt;</div></div><br/>　　解决办法和left定位类似：<br/>　　方法1是给父层设置zoom触发layout。<br/>　　方法2是给父层设置高度（height）。<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">&lt;!–解决方法1&nbsp;zoom:1–&gt;<br/>&lt;hr&nbsp;/&gt;<br/>&lt;div&nbsp;style=”position:relative;border:1px&nbsp;solid&nbsp;o&#114;ange;zoom:1;text-align:center;”&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a&nbsp;href=”<a href="http://www.52css.com" target="_blank">http://www.52css.com</a>”&gt;<a href="http://www.52css.com/" target="_blank">http://www.52css.com/</a>&lt;/a&gt;&lt;br&nbsp;/&gt;<br/>&lt;a&nbsp;href=”<a href="http://www.52css.com" target="_blank">http://www.52css.com</a>”&gt;<a href="http://www.52css.com/" target="_blank">http://www.52css.com/</a>&lt;/a&gt;<br/>&lt;div&nbsp;style=”position:absolute;bottom:0;left:0;background:#CCC;”&gt;52CSS&lt;/div&gt;<br/>&lt;/div&gt;<br/>&lt;!–解决方法2&nbsp;设置height–&gt;<br/>&lt;hr&nbsp;/&gt;<br/>&lt;div&nbsp;style=”position:relative;height:60px;border:1px&nbsp;solid&nbsp;o&#114;ange;text-align:center;”&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a&nbsp;href=”<a href="http://www.52css.com" target="_blank">http://www.52css.com</a>”&gt;<a href="http://www.52css.com/" target="_blank">http://www.52css.com/</a>&lt;/a&gt;<br/>&lt;div&nbsp;style=”position:absolute;bottom:0;left:0;background:#CCC;”&gt;52CSS&lt;/div&gt;<br/>&lt;/div&gt;</div></div><br/>　　IE6中很多Bug都可以通过触发layout得到解决，以上的解决方法无论是设置zoom:1还是设置width和height其实都是为了触发layout。下列的CSS属性或取值会让一个元素获得layout：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>　　position:absolute&nbsp;绝对定位元素的包含区块(containing&nbsp;block)就会经常在这一方面出问题<br/>　　float:left|right&nbsp;由于layout元素的特性，浮动模型会有很多怪异的表现<br/>　　display:inline-block&nbsp;当一个内联级别的元素需要layout的时候就往往符用到它，这也可能也是这个CSS属性的唯一效果—-让某个元素有layout<br/>　　width:&nbsp;除auto外的任何值<br/>　　height:&nbsp;除auto外的任何值<br/>　　zoom:&nbsp;除auto外的任何值]]></description>
		</item>
		
			<item>
			<link>http://www.52css.com/default.asp?id=1192</link>
			<title><![CDATA[开发备必：WEB前端开发规范文档]]></title>
			<author>MrJin@52css.com(52css)</author>
			<category><![CDATA[Div+CSS教程]]></category>
			<pubDate>Mon,10 Jan 2011 21:41:20 +0800</pubDate>
			<guid>http://www.52css.com/default.asp?id=1192</guid>	
		<description><![CDATA[<strong>规范目的</strong><br/>　　为提高团队协作效率,&nbsp;便于后台人员添加功能及前端后期优化维护,&nbsp;输出高质量的文档,&nbsp;特制订此文档.&nbsp;本规范文档一经确认,&nbsp;前端开发人员必&nbsp;须按本文档规范进行前台页面开发.&nbsp;本文档如有不对或者不合适的地方请及时提出,&nbsp;经讨论决定后方可更改.<br/><br/><strong>基本准则</strong><br/>　　符合web标准,&nbsp;语义化html,&nbsp;结构表现行为分离,&nbsp;兼容性优良.&nbsp;页面性能方面,&nbsp;代码要求简洁明了有序,&nbsp;尽可能的减小服务器负载,&nbsp;保证最快的&nbsp;解析速度.<br/><br/><strong>文件规范</strong><br/>　　1.&nbsp;html,&nbsp;css,&nbsp;js,&nbsp;images文件均归档至&lt;系统开发规范&gt;约定的目录中;<br/>　　2.&nbsp;html文件命名:&nbsp;英文命名,&nbsp;后缀.htm.&nbsp;同时将对应界面稿放于同目录中,&nbsp;若界面稿命名为中文,&nbsp;请重命名与html文件同名,&nbsp;以方便后端添加&nbsp;功能时查找对应页面;<br/>　　3.&nbsp;css文件命名:&nbsp;英文命名,&nbsp;后缀.css.&nbsp;共用base.css,&nbsp;首页index.css,&nbsp;其他页面依实际模块需求命名.;<br/>　　4.&nbsp;Js文件命名:&nbsp;英文命名,&nbsp;后缀.js.&nbsp;共用common.js,&nbsp;其他依实际模块需求命名.<br/><br/><strong>html书写规范</strong><br/>　　1.&nbsp;文档类型声明及编码:&nbsp;统一为html5声明类型&lt;!DOCTYPE&nbsp;html&gt;;&nbsp;编码统一为&lt;meta&nbsp;charset=&#34;gbk&#34;&nbsp;/&gt;,&nbsp;书写时利用IDE实现层&nbsp;次分明的缩进;<br/>　　2.&nbsp;非特殊情况下样式文件必须外链至&lt;head&gt;...&lt;/head&gt;之间;非特殊情况下JavaScript文件必须外链至页面底部;<br/>　　3.&nbsp;引入样式文件或JavaScript文件时,&nbsp;须略去默认类型声明,&nbsp;写法如下:<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">&lt;link&nbsp;rel=&#34;stylesheet&#34;&nbsp;href=&#34;...&#34;&nbsp;/&gt;<br/>&lt;style&gt;...&lt;/style&gt;<br/>&lt;script&nbsp;src=&#34;...&#34;&gt;&lt;/script&gt;</div></div><br/>　　4.&nbsp;引入JS库文件,&nbsp;文件名须包含库名称及版本号及是否为压缩版,&nbsp;比如jquery-1.4.1.min.js;&nbsp;引入插件,&nbsp;文件名格式为库名称+插件名称,&nbsp;比&nbsp;如jQuery.cookie.js;<br/>　　5.&nbsp;所有编码均遵循xhtml标准,&nbsp;标签&nbsp;&amp;&nbsp;属性&nbsp;&amp;&nbsp;属性命名&nbsp;必须由小写字母及下划线数字组成,&nbsp;且所有标签必须闭合,&nbsp;包括&nbsp;br&nbsp;(&lt;br&nbsp;/&gt;),&nbsp;hr(&lt;hr&nbsp;/&gt;)等;&nbsp;属性值必须用双引号包括;<br/>　　6.&nbsp;充分利用无兼容性问题的html自身标签,&nbsp;比如span,&nbsp;em,&nbsp;strong,&nbsp;optgroup,&nbsp;label,等等;&nbsp;需要为html元素添加自定义属性的时候,&nbsp;首先&nbsp;要考虑下有没有默认的已有的合适标签去设置,&nbsp;如果没有,&nbsp;可以使用须以&#34;data-&#34;为前缀来添加自定义属性，避免使用&#34;data:&#34;等其他命名方式;<br/>　　7.&nbsp;语义化html,&nbsp;如&nbsp;标题根据重要性用h*(同一页面只能有一个h1),&nbsp;段落标记用p,&nbsp;列表用ul,&nbsp;内联元素中不可嵌套块级元素;<br/>　　8.&nbsp;尽可能减少div嵌套,&nbsp;如&lt;div&nbsp;class=&#34;box&#34;&gt;&lt;div&nbsp;class=&#34;welcome&#34;&gt;欢迎访问XXX,&nbsp;您的用&nbsp;户名是&lt;div&nbsp;class=&#34;name&#34;&gt;用户名&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;完全可以用以下代码替代:&nbsp;&lt;div&nbsp;class=&#34;box&#34;&gt;&lt;p&gt;欢迎&nbsp;访问XXX,&nbsp;您的用户名是&lt;span&gt;用户名&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;;<br/>　　9.&nbsp;书写链接地址时,&nbsp;必须避免重定向，例如：href=&#34;<a href="http://itaolun.com/" target="_blank">http://itaolun.com/</a>&#34;,&nbsp;即须在URL地址后面加上“/”；<br/>　　10.&nbsp;在页面中尽量避免使用style属性,即style=&#34;…&#34;;<br/>　　11.&nbsp;必须为含有描述性表单元素(input,&nbsp;textarea)添加label,&nbsp;如<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">&lt;p&gt;姓&nbsp;名:&nbsp;&lt;input&nbsp;type=&#34;text&#34;&nbsp;id=&#34;name&#34;&nbsp;name=&#34;name&#34;&nbsp;/&gt;&lt;/p&gt;<br/>须写成:<br/>&lt;p&gt;&lt;label&nbsp;for=&#34;name&#34;&gt;姓&nbsp;名:&nbsp;&lt;/label&gt;&lt;input&nbsp;type=&#34;text&#34;&nbsp;id=&#34;name&#34;&nbsp;/&gt;&lt;/p&gt;</div></div><br/>　　12.&nbsp;能以背景形式呈现的图片,&nbsp;尽量写入css样式中;<br/>　　13.&nbsp;重要图片必须加上alt属性;&nbsp;给重要的元素和截断的元素加上title;<br/>　　14.&nbsp;给区块代码及重要功能(比如循环)加上注释,&nbsp;方便后台添加功能;<br/>　　15.&nbsp;特殊符号使用:&nbsp;尽可能使用代码替代:&nbsp;比如&nbsp;&lt;(&lt;)&nbsp;&amp;&nbsp;&gt;(&amp;gt;)&nbsp;&amp;&nbsp;空格(&nbsp;)&nbsp;&amp;&nbsp;»(»)&nbsp;等等;<br/>　　16.&nbsp;书写页面过程中,&nbsp;请考虑向后扩展性;<br/>　　17.&nbsp;class&nbsp;&amp;&nbsp;id&nbsp;参见&nbsp;css书写规范.<br/><br/><strong>css书写规范</strong><br/>　　1.&nbsp;编码统一为utf-8;<br/>　　2.&nbsp;协作开发及分工:&nbsp;i会根据各个模块,&nbsp;同时根据页面相似程序,&nbsp;事先写好大体框架文件,&nbsp;分配给前端人员实现内部结构&amp;表现&amp;行为;&nbsp;&nbsp;共用css文件base.css由i书写,&nbsp;协作开发过程中,&nbsp;每个页面请务必都要引入,&nbsp;此文件包含reset及头部底部样式,&nbsp;此文件不可随意修改;<br/>　　3.&nbsp;class与id的使用:&nbsp;id是唯一的并是父级的,&nbsp;class是可以重复的并是子级的,&nbsp;所以id仅使用在大的模块上,&nbsp;class可用在重复使用率高及子级&nbsp;中;&nbsp;id原则上都是由我分发框架文件时命名的,&nbsp;为JavaScript预留钩子的除外;<br/>　　4.&nbsp;为JavaScript预留钩子的命名,&nbsp;请以&nbsp;js_&nbsp;起始,&nbsp;比如:&nbsp;js_hide,&nbsp;js_show;<br/>　　5.&nbsp;class与id命名:&nbsp;大的框架命名比如header/footer/wrapper/left/right之类的在2中由i统一命名.其他样式名称由&nbsp;小写英文&nbsp;&amp;&nbsp;数&nbsp;字&nbsp;&amp;&nbsp;_&nbsp;来组合命名,&nbsp;如i_comment,&nbsp;fontred,&nbsp;width200;&nbsp;避免使用中文拼音,&nbsp;尽量使用简易的单词组合;&nbsp;总之,&nbsp;命名要语义化,&nbsp;简明&nbsp;化.<br/>　　6.&nbsp;规避class与id命名(此条重要,&nbsp;若有不明白请及时与i沟通):<br/>　　　　a,&nbsp;通过从属写法规避,&nbsp;示例见d;<br/>　　　　b,&nbsp;取父级元素id/class命名部分命名,&nbsp;示例见d;<br/>　　　　c,&nbsp;重复使用率高的命名,&nbsp;请以自己代号加下划线起始,&nbsp;比如i_clear;<br/>　　　　d,&nbsp;a,b两条,&nbsp;适用于在2中已建好框架的页面,&nbsp;如,&nbsp;<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">要在2中已建好框架的页面代码&lt;div&nbsp;id=&#34;mainnav&#34;&gt;&lt;/div&gt;中加入新的div元&nbsp;素,<br/>按a命名法则:&nbsp;&lt;div&nbsp;id=&#34;mainnav&#34;&gt;&lt;div&nbsp;class=&#34;firstnav&#34;&gt;...&lt;/div&gt;&lt;/div&gt;,<br/>样式写法:&nbsp;&nbsp;#mainnav&nbsp;&nbsp;.firstnav{.......}<br/>按b命名法则:&nbsp;&lt;div&nbsp;id=&#34;mainnav&#34;&gt;&lt;div&nbsp;class=&#34;main_firstnav&#34;&gt;...&lt;/div&gt;&lt;/div&gt;,<br/>样式写法:&nbsp;&nbsp;.main_firstnav{.......}</div></div><br/>　　7.&nbsp;css属性书写顺序,&nbsp;建议遵循:&nbsp;&nbsp;布局定位属性--&gt;自身属性--&gt;文本属性--&gt;其他属性.&nbsp;此条可根据自身习惯书写,&nbsp;但尽量保证同类属&nbsp;性写在一起.&nbsp;<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">属性列举:&nbsp;<br/>布局定位属性主要包括:&nbsp;display&nbsp;&amp;&nbsp;list-style&nbsp;&amp;&nbsp;position（相应&nbsp;的&nbsp;top,right,bottom,left）&nbsp;＆&nbsp;<br/>float&nbsp;&amp;&nbsp;clear&nbsp;＆&nbsp;visibility&nbsp;＆&nbsp;overflow；&nbsp;<br/>自身属性主要包括:&nbsp;width&nbsp;&amp;&nbsp;height&nbsp;&amp;&nbsp;margin&nbsp;&amp;&nbsp;padding&nbsp;&amp;&nbsp;border&nbsp;&amp;&nbsp;background;&nbsp;<br/>文本属性主要包括：color&nbsp;&amp;&nbsp;font&nbsp;&amp;&nbsp;text-decoration&nbsp;&amp;&nbsp;text-align&nbsp;&amp;&nbsp;vertical-align&nbsp;&amp;&nbsp;white-&nbsp;space&nbsp;&amp;&nbsp;<br/>其他&nbsp;&amp;&nbsp;content;&nbsp;<br/>我所列出的这些属性只是最常用到的,&nbsp;并不代表全部;</div></div><br/>　　8.&nbsp;书写代码前,&nbsp;考虑并提高样式重复使用率;<br/>　　9.&nbsp;充分利用html自身属性及样式继承原理减少代码量,&nbsp;比如:<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">&lt;ul&nbsp;class=&#34;list&#34;&gt;&lt;li&gt;这儿是标题列表&lt;span&gt;2010-09-&nbsp;15&lt;/span&gt;&lt;/ul&gt;<br/>定义<br/>ul.list&nbsp;li{position:relative}&nbsp;&nbsp;ul.list&nbsp;li&nbsp;span{position:absolute;&nbsp;right:0}<br/>即可实现日期居右显示</div></div><br/>　　10.&nbsp;样式表中中文字体名,&nbsp;请务必转码成unicode码,&nbsp;以避免编码错误时乱码;<br/>　　11.&nbsp;背景图片请尽可能使用sprite技术,&nbsp;减小http请求,&nbsp;考虑到多人协作开发,&nbsp;sprite按模块制作;<br/>　　12.&nbsp;使用table标签时(尽量避免使用table标签),&nbsp;请不要用width/&nbsp;height/cellspacing/cellpadding等table属性直接定义表现,&nbsp;应尽可能的利用table自身私有属性分离结构与表现&nbsp;,&nbsp;如<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">thead,tr,th,td,tbody,tfoot,colgroup,scope;<br/>&nbsp;(cellspaing及cellpadding的css控制方法:&nbsp;<br/>table{border:0;margin:0;border-collapse:collapse;}&nbsp;table&nbsp;th,&nbsp;table&nbsp;td{padding:0;}&nbsp;,&nbsp;<br/>base.css文件中我会初始化表格样式)</div></div><br/>　　13.&nbsp;杜绝使用&lt;meta&nbsp;http-equiv=&#34;X-UA-Compatible&#34;&nbsp;content=&#34;IE=7&#34;&nbsp;/&gt;&nbsp;兼容&nbsp;ie8;<br/>　　14.&nbsp;用png图片做图片时,&nbsp;要求图片格式为png-8格式,若png-8实在影响图片质量或其中有半透明效果,&nbsp;请为ie6单独定义背景:<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader&nbsp;<br/>(sizingMethod=crop,&nbsp;src=’img/bg.png’);</div></div><br/>　　15.&nbsp;避免兼容性属性的使用,&nbsp;比如text-shadow&nbsp;||&nbsp;css3的相关属性;<br/>　　16.&nbsp;减少使用影响性能的属性,&nbsp;比如position:absolute&nbsp;||&nbsp;float&nbsp;;<br/>　　17.&nbsp;必须为大区块样式添加注释,&nbsp;小区块适量注释;<br/>　　18.&nbsp;代码缩进与格式:&nbsp;建议单行书写,&nbsp;可根据自身习惯,&nbsp;后期优化i会统一处理;<br/><br/><strong>JavaScript书写规范</strong><br/>　　1.&nbsp;文件编码统一为utf-8,&nbsp;书写过程过,&nbsp;每行代码结束必须有分号;&nbsp;原则上所有功能均根据XXX项目需求原生开发,&nbsp;以避免网上down下来的代码造&nbsp;成的代码污染(沉冗代码&nbsp;||&nbsp;与现有代码冲突&nbsp;||&nbsp;...);<br/>　　2.&nbsp;库引入:&nbsp;原则上仅引入jQuery库,&nbsp;若需引入第三方库,&nbsp;须与团队其他人员讨论决定;<br/>　　3.&nbsp;变量命名:&nbsp;驼峰式命名.&nbsp;原生JavaScript变量要求是纯英文字母,&nbsp;首字母须小写,&nbsp;如iTaoLun;<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">jQuery变量要求首字符为&#39;_&#39;,&nbsp;其他与原生JavaScript&nbsp;规则相同,&nbsp;如:&nbsp;_iTaoLun;<br/>另,&nbsp;要求变量集中声明,&nbsp;避免全局变量.</div></div><br/>　　4.&nbsp;类命名:&nbsp;首字母大写,&nbsp;驼峰式命名.&nbsp;如&nbsp;ITaoLun;<br/>　　5.&nbsp;函数命名:&nbsp;首字母小写驼峰式命名.&nbsp;如iTaoLun();<br/>　　6.&nbsp;命名语义化,&nbsp;尽可能利用英文单词或其缩写;<br/>　　7.&nbsp;尽量避免使用存在兼容性及消耗资源的方法或属性,&nbsp;比如eval()&nbsp;&amp;&nbsp;innerText;<br/>　　8.&nbsp;后期优化中,&nbsp;JavaScript非注释类中文字符须转换成unicode编码使用,&nbsp;以避免编码错误时乱码显示;<br/>　　9.&nbsp;代码结构明了,&nbsp;加适量注释.&nbsp;提高函数重用率;<br/>　　10.&nbsp;注重与html分离,&nbsp;减小reflow,&nbsp;注重性能.<br/><br/><strong>图片规范</strong><br/>　　1.&nbsp;所有页面元素类图片均放入img文件夹,&nbsp;测试用图片放于img/demoimg文件夹;<br/>　　2.&nbsp;图片格式仅限于gif&nbsp;||&nbsp;png&nbsp;||&nbsp;jpg;<br/>　　3.&nbsp;命名全部用小写英文字母&nbsp;||&nbsp;数字&nbsp;||&nbsp;_&nbsp;的组合，其中不得包含汉字&nbsp;||&nbsp;空格&nbsp;||&nbsp;特殊字符；尽量用易懂的词汇,&nbsp;便于团队其他成员理&nbsp;解;&nbsp;另,&nbsp;命名分头尾两部分,&nbsp;用下划线隔开,&nbsp;比如ad_left01.gif&nbsp;||&nbsp;btn_submit.gif;<br/>　　4.&nbsp;在保证视觉效果的情况下选择最小的图片格式与图片质量,&nbsp;以减少加载时间;<br/>　　5.&nbsp;尽量避免使用半透明的png图片(若使用,&nbsp;请参考css规范相关说明);<br/>　　6.&nbsp;运用css&nbsp;sprite技术集中小的背景图或图标,&nbsp;减小页面http请求,&nbsp;但注意,&nbsp;请务必在对应的sprite&nbsp;psd源图中划参考线,&nbsp;并保存至img目录&nbsp;下.<br/><br/><strong>注释规范</strong><br/>　　1.&nbsp;html注释:&nbsp;注释格式&nbsp;&lt;!--这儿是注释--&gt;,&nbsp;&#39;--&#39;只能在注释的始末位置,不可置入注释文字区域;<br/>　　2.&nbsp;css注释:&nbsp;注释格式&nbsp;/*这儿是注释*/;<br/>　　3.&nbsp;JavaScript注释,&nbsp;单行注释使用&#39;//这儿是单行注释&#39;&nbsp;,多行注释使用&nbsp;/*&nbsp;这儿有多行注释&nbsp;*/;<br/><br/><strong>开发及测试工具约定</strong><br/>　　建议使用Aptana&nbsp;||&nbsp;Dw&nbsp;||&nbsp;Vim&nbsp;,&nbsp;亦可根据自己喜好选择,&nbsp;但须遵循如下原则:<br/>　　1.&nbsp;不可利用IDE的视图模式&#39;画&#39;代码;<br/>　　2.&nbsp;不可利用IDE生成相关功能代码,&nbsp;比如Dw内置的一些功能js;<br/>　　3.&nbsp;编码必须格式化,&nbsp;比如缩进;<br/>　　测试工具:&nbsp;前期开发仅测试FireFox&nbsp;&amp;&nbsp;IE6&nbsp;&amp;&nbsp;IE7&nbsp;&amp;&nbsp;IE8&nbsp;,&nbsp;后期优化时加入Opera&nbsp;&amp;&nbsp;Chrome&nbsp;&amp;&nbsp;Safari;<br/>　　建议测试顺序:&nbsp;FireFox--&gt;IE7--&gt;IE8--&gt;IE6--&gt;Opera--&gt;Chrome--&gt;Safari,&nbsp;建议安装firebug及IE&nbsp;Tab&nbsp;Plus插件.<br/><br/><strong>其他规范</strong><br/>　　1.&nbsp;开发过程中严格按分工完成页面,&nbsp;以提高css复用率,&nbsp;避免重复开发;<br/>　　2.&nbsp;减小沉冗代码,&nbsp;书写所有人都可以看的懂的代码.&nbsp;简洁易懂是一种美德.&nbsp;为用户着想,&nbsp;为服务器着想.]]></description>
		</item>
		
			<item>
			<link>http://www.52css.com/default.asp?id=1191</link>
			<title><![CDATA[DivCSS+JavaScript实现 始终居中的半透明弹出层]]></title>
			<author>MrJin@52css.com(52css)</author>
			<category><![CDATA[CSS布局实例]]></category>
			<pubDate>Tue,04 Jan 2011 19:24:55 +0800</pubDate>
			<guid>http://www.52css.com/default.asp?id=1191</guid>	
		<description><![CDATA[　　DivCSS+JavaScript实现弹出一个始终居中的半透明层，它可以自动适应浏览器窗口大小，拖动IE滚动条它仍然居中，而且还可以改变它的透明度，和大站的效果是一样的。&nbsp;<br/>　　<strong>先看HTML代码：</strong><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">&lt;div&nbsp;id=&#34;popDiv&#34;&nbsp;class=&#34;mydiv&#34;&nbsp;style=&#34;display:none;&#34;&gt;52CSS.com欢迎你！&lt;br/&gt;Q群号:48822948&lt;br/&gt;<br/>&lt;a&nbsp;href=&#34;javascript:closeDiv()&#34;&gt;关闭窗口&lt;/a&gt;&lt;/div&gt;<br/>&lt;div&nbsp;id=&#34;bg&#34;&nbsp;class=&#34;bg&#34;&nbsp;style=&#34;display:none;&#34;&gt;&lt;/div&gt;<br/>&lt;a&nbsp;href=&#34;javascript:showDiv()&#34;&gt;点击这里弹出层&lt;/a&gt;<br/>&lt;iframe&nbsp;id=&#39;popIframe&#39;&nbsp;class=&#39;popIframe&#39;&nbsp;frameborder=&#39;0&#39;&nbsp;&gt;&lt;/iframe&gt;</div></div><br/>　　<strong>再编写CSS样式：</strong><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">html,body&nbsp;{height:100%;&nbsp;margin:0px;&nbsp;font-size:12px;}<br/>.mydiv&nbsp;{<br/>background-color:&nbsp;#FFCC66;<br/>border:&nbsp;1px&nbsp;solid&nbsp;#f00;<br/>text-align:&nbsp;center;<br/>line-height:&nbsp;40px;<br/>font-size:&nbsp;12px;<br/>font-weight:&nbsp;bold;<br/>z-index:999;<br/>width:&nbsp;300px;<br/>height:&nbsp;120px;<br/>left:50%;<br/>top:50%;<br/>margin-left:-150px!important;/*FF&nbsp;IE7&nbsp;该值为本身宽的一半&nbsp;*/<br/>margin-top:-60px!important;/*FF&nbsp;IE7&nbsp;该值为本身高的一半*/<br/>margin-top:0px;<br/>position:fixed!important;/*&nbsp;FF&nbsp;IE7*/<br/>position:absolute;/*IE6*/<br/>_top:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;expression(eval(document.compatMode&nbsp;&amp;&amp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.compatMode==&#39;CSS1Compat&#39;)&nbsp;?<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentElement.scrollTop&nbsp;+&nbsp;(document.documentElement.clientHeight-this.offsetHeight)/2&nbsp;:/*IE6*/<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.body.scrollTop&nbsp;+&nbsp;(document.body.clientHeight&nbsp;-&nbsp;this.clientHeight)/2);/*IE5&nbsp;IE5.5*/<br/>}<br/>.bg,.popIframe&nbsp;{<br/>background-color:&nbsp;#666;&nbsp;display:none;<br/>width:&nbsp;100%;<br/>height:&nbsp;100%;<br/>left:0;<br/>top:0;/*FF&nbsp;IE7*/<br/>filter:alpha(opacity=50);/*IE*/<br/>opacity:0.5;/*FF*/<br/>z-index:1;<br/>position:fixed!important;/*FF&nbsp;IE7*/<br/>position:absolute;/*IE6*/<br/>_top:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;expression(eval(document.compatMode&nbsp;&amp;&amp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.compatMode==&#39;CSS1Compat&#39;)&nbsp;?<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentElement.scrollTop&nbsp;+&nbsp;(document.documentElement.clientHeight-this.offsetHeight)/2&nbsp;:/*IE6*/<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.body.scrollTop&nbsp;+&nbsp;(document.body.clientHeight&nbsp;-&nbsp;this.clientHeight)/2);<br/>}<br/>.popIframe&nbsp;{<br/>filter:alpha(opacity=0);/*IE*/<br/>opacity:0;/*FF*/<br/>}</div></div><br/>　　<strong>通过JavaScript实现层的隐藏与显示切换：</strong><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">function&nbsp;showDiv(){<br/>document.getElementById(&#39;popDiv&#39;).style.display=&#39;block&#39;;<br/>document.getElementById(&#39;popIframe&#39;).style.display=&#39;block&#39;;<br/>document.getElementById(&#39;bg&#39;).style.display=&#39;block&#39;;<br/>}<br/>function&nbsp;closeDiv(){<br/>document.getElementById(&#39;popDiv&#39;).style.display=&#39;none&#39;;<br/>document.getElementById(&#39;bg&#39;).style.display=&#39;none&#39;;<br/>document.getElementById(&#39;popIframe&#39;).style.display=&#39;none&#39;;<br/>}</div></div><br/>　　<strong>查看最终的运行效果：</strong><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/html.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Source Code to Run"> Source Code to Run <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent"><TEXTAREA cols="60" rows="8" id="temp35697">
<!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>&#34;>
<html xmlns=&#34;<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>&#34;>
<head>
<meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=gb2312&#34; />
<title>52CSS.com - DivCSS实现 始终居中的半透明弹出层</title>
<style type=&#34;text/css&#34;>
<!--
html,body {height:100%; margin:0px; font-size:12px;}
.mydiv {
background-color: #FFCC66;
border: 1px solid #f00;
text-align: center;
line-height: 40px;
font-size: 12px;
font-weight: bold;
z-index:999;
width: 300px;
height: 120px;
left:50%;
top:50%;
margin-left:-150px!important;/*FF IE7 该值为本身宽的一半 */
margin-top:-60px!important;/*FF IE7 该值为本身高的一半*/
margin-top:0px;
position:fixed!important;/* FF IE7*/
position:absolute;/*IE6*/
_top:       expression(eval(document.compatMode &amp;&amp;
            document.compatMode=='CSS1Compat') ?
            documentElement.scrollTop + (document.documentElement.clientHeight-this.offsetHeight)/2 :/*IE6*/
            document.body.scrollTop + (document.body.clientHeight - this.clientHeight)/2);/*IE5 IE5.5*/
}
.bg,.popIframe {
background-color: #666; display:none;
width: 100%;
height: 100%;
left:0;
top:0;/*FF IE7*/
filter:alpha(opacity=50);/*IE*/
opacity:0.5;/*FF*/
z-index:1;
position:fixed!important;/*FF IE7*/
position:absolute;/*IE6*/
_top:       expression(eval(document.compatMode &amp;&amp;
            document.compatMode=='CSS1Compat') ?
            documentElement.scrollTop + (document.documentElement.clientHeight-this.offsetHeight)/2 :/*IE6*/
            document.body.scrollTop + (document.body.clientHeight - this.clientHeight)/2);
}
.popIframe {
filter:alpha(opacity=0);/*IE*/
opacity:0;/*FF*/
}
-->
</style>
<script language=&#34;javascript&#34; type=&#34;text/javascript&#34;>
function showDiv(){
document.getElementById('popDiv').style.display='block';
document.getElementById('popIframe').style.display='block';
document.getElementById('bg').style.display='block';
}
function closeDiv(){
document.getElementById('popDiv').style.display='none';
document.getElementById('bg').style.display='none';
document.getElementById('popIframe').style.display='none';
}
</script>
</head>
<body>
<div id=&#34;popDiv&#34; class=&#34;mydiv&#34; style=&#34;display:none;&#34;>52CSS.com欢迎你！
Q群号:48822948

<a href=&#34;javascript:closeDiv()&#34;>关闭窗口</a></div>
<div id=&#34;bg&#34; class=&#34;bg&#34; style=&#34;display:none;&#34;></div>
<a href=&#34;javascript:showDiv()&#34;>点击这里弹出层</a>
<iframe id='popIframe' class='popIframe' frameborder='0' ></iframe>
</body>
</html>
</TEXTAREA><br/><INPUT onclick="runEx('temp35697')"  type="button" class="ubbbutton" value="运行此代码"/> <INPUT onclick="doCopy('temp35697')"  type="button" class="ubbbutton" value="复制此代码"/>&nbsp;&nbsp;&nbsp;&nbsp;<span class="ubbbuttonrt">[ 可先修改部分代码 再运行查看效果 ]</span></div></div>]]></description>
		</item>
		
			<item>
			<link>http://www.52css.com/default.asp?id=1190</link>
			<title><![CDATA[详谈CSS网页布局中容易发生的错误编码]]></title>
			<author>MrJin@52css.com(52css)</author>
			<category><![CDATA[Div+CSS教程]]></category>
			<pubDate>Fri,24 Dec 2010 23:07:23 +0800</pubDate>
			<guid>http://www.52css.com/default.asp?id=1190</guid>	
		<description><![CDATA[　　随着CSS网页布局越来越普及，国内大部分网站已经采用CSS网页布局的制作方法，现在52CSS.com也成为了CSS网页布局技术学习的先锋站点。在应用DIV+CSS编码时很容易犯一些错误，这里列举一些常见的错误，帮助新手朋友更好的学习与进步。<br/><br/>　　一、检查HTML元素是否有拼写错误&nbsp;是否忘记结束标记<br/>　　即使是老手也经常会弄错div的嵌套关系。可以用dreamweaver的验证功能检查一下有无错误。<br/><br/>　　二、检查CSS是否正确<br/>　　检查一下有无拼写错误、是否忘记结尾的&nbsp;}&nbsp;等。可以利用CleanCSS来检查&nbsp;CSS的拼写错误。CleanCSS本是为CSS减肥的工具，但也能检查出拼写错误。<br/><br/>　　三、确定错误发生的位置<br/>　　如果错误影响了整体布局，则可以逐个删除div块，直到删除某个div块后显示恢复正常，即可确定错误发生的位置。<br/><br/>　　四、利用border属性确定出错元素的布局特性<br/>　　使用float属性布局一不小心就会出错。这时为元素添加border属性确定元素边界，错误原因即水落石出。<br/><br/>　　五、float元素的父元素不能指定clear属性<br/>　　MacIE下如果对float的元素的父元素使用clear属性，周围的float元素布局就会混乱。这是MacIE的著名的bug，倘若不知道就会走弯路。<br/><br/>　　六、float元素务必指定width属性<br/>　　很多浏览器在显示未指定width的float元素时会有bug。所以不管float元素的内容如何，一定要为其指定width属性。<br/><br/>　　七、float元素不能指定margin和padding等属性<br/>　　IE在显示指定了margin和padding的float元素时有bug。因此不要对float元素指定margin和padding属性(可以在float元素内部嵌套一个div来设置margin和padding)。也可以使用hack方法为IE指定特别的值。<br/><br/>　　八、float元素的宽度之和要小于100%<br/>　　如果float元素的宽度之和正好是100%，某些古老的浏览器将不能正常显示。因此请保证宽度之和小于99%。<br/><br/>　　九、是否重设了默认的样式?<br/>　　某些属性如margin、padding等，不同浏览器会有不同的解释。因此最好在开发前首先将全体的margin、padding设置为0、列表样式设置为none等。<br/><br/>　　十、是否忘记了写DTD<br/>　　如果无论怎样调整不同浏览器显示结果还是不一样，那么可以检查一下页面开头。<br/>　　]]></description>
		</item>
		
			<item>
			<link>http://www.52css.com/default.asp?id=1189</link>
			<title><![CDATA[利用CSS的@font-face属性 在网页中嵌入字体]]></title>
			<author>MrJin@52css.com(52css)</author>
			<category><![CDATA[CSS2.0教程]]></category>
			<pubDate>Wed,22 Dec 2010 22:14:32 +0800</pubDate>
			<guid>http://www.52css.com/default.asp?id=1189</guid>	
		<description><![CDATA[　　字体使用是网页设计中不可或缺的一部分。网页是文字的载体，我们希望在网页中使用某一特定字体，但是该字体并非主流操作系统的内置字体，这样用户在浏览页面的时候就有可能看不到真实的设计。<br/>　　美工设计师最常做的办法是把想要的文字做成图片，这样做有几个明显缺陷：<br/>　　一、不可能大范围的使用该字体；<br/>　　二、图片内容相对使用文字不易修改；<br/>　　三、不利于网站SEO。<br/>　　网络上有一些使用sIFR技术、或javascript/flash&nbsp;hack的方法，但实现起来或繁琐，或有缺陷。下面要讲的是如何只通过CSS的@font-face属性来实现在网页中嵌入任意字体。<br/><br/>　　<strong>首先</strong>&nbsp;<br/>　　获取要使用字体的三种文件格式，确保能在主流浏览器中都能正常显示该字体。&nbsp;<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">.TTF或.OTF，适用于Firefox&nbsp;3.5、Safari、Opera&nbsp;<br/>.EOT，适用于Internet&nbsp;Explorer&nbsp;4.0+&nbsp;<br/>.SVG，适用于Chrome、IPhone</div></div><br/>　　下面要解决的是如何获取到某种字体的这三种格式文件。一般地，我们在手头上（或在设计资源站点已经找到）有该字体的某种格式文件，最常见的是.TTF文件，我们需要通过这种文件格式转换为其余两种文件格式。字体文件格式的转换可以通过网站FontsQuirrel或onlinefontconverter提供的在线字体转换服务获取。这里推荐第一个站点，它允许我们选择需要的字符生成字体文件（在服务的最后一个选项），这样就大大缩减了字体文件的大小，使得本方案更具实用性。&nbsp;<br/><br/><strong>然后</strong><br/>　　获取到三种格式的字体文件后，下一步要在样式表中声明该字体，并在需要的地方使用该字体。&nbsp;<br/>　　字体声明如下：&nbsp;<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">@font-face&nbsp;{&nbsp;<br/>font-family:&nbsp;&#39;fontNameRegular&#39;;&nbsp;<br/>src:&nbsp;url(&#39;fontName.eot&#39;);&nbsp;<br/>src:&nbsp;local(&#39;fontName&nbsp;Regular&#39;),&nbsp;<br/>local(&#39;fontName&#39;),&nbsp;<br/>url(&#39;fontName.woff&#39;)&nbsp;format(&#39;woff&#39;),&nbsp;<br/>url(&#39;fontName.ttf&#39;)&nbsp;format(&#39;truetype&#39;),&nbsp;<br/>url(&#39;fontName.svg#fontName&#39;)&nbsp;format(&#39;svg&#39;);&nbsp;<br/>}&nbsp;<br/>/*其中fontName替换为你的字体名称&nbsp;-&nbsp;52CSS.com*/&nbsp;</div></div><br/>　　在页面中需要的地方使用该字体：&nbsp;<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">p&nbsp;{&nbsp;font:&nbsp;13px&nbsp;fontNameRegular,&nbsp;Arial,&nbsp;sans-serif;&nbsp;}&nbsp;<br/>h1{font-family:&nbsp;fontNameRegular}&nbsp;</div></div><br/>或者&nbsp;<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">&lt;p&nbsp;style=&#34;font-family:&nbsp;fontNameRegular&#34;&gt;掬水月在手，落花香满衣。&lt;/p&gt;</div></div><br/>　　]]></description>
		</item>
		
			<item>
			<link>http://www.52css.com/default.asp?id=1188</link>
			<title><![CDATA[说说九个CSS3结构性伪类选择器]]></title>
			<author>MrJin@52css.com(52css)</author>
			<category><![CDATA[CSS2.0教程]]></category>
			<pubDate>Mon,20 Dec 2010 22:30:13 +0800</pubDate>
			<guid>http://www.52css.com/default.asp?id=1188</guid>	
		<description><![CDATA[　　我们在52CSS前面的文章中，陆续为大家讲了多种CSS选择器。今天说说九个CSS3结构性伪类选择器。<br/><br/><strong>一、X:nth-child(n)</strong><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">li:nth-child(3)&nbsp;{<br/>color:&nbsp;red;<br/>}</div></div><br/>　　接下来的几个伪类选择器使用上非常类似，功能也比较接近。<br/>　　:nth-child(n)，用于匹配索引值为n的子元素。索引值从1开始。<br/>　　X:nth-child()用法实际上有三种变化，demo的用法是最简单的，X:nth-child()更强大的用处在于奇偶匹配，明河不展开讲，有兴趣的请看《Understanding&nbsp;:nth-child&nbsp;Pseudo-class&nbsp;Expressions》,《CSS3&nbsp;:nth-child()伪类选择器》<br/><br/><strong>二、X:nth-last-child(n)</strong><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">li:nth-last-child(2)&nbsp;{<br/>color:&nbsp;red;<br/>}</div></div><br/>　　:nth-child(n)，是从第一个开始算索引，而X:nth-last-child(n)是从最后一个开始算索引。<br/><br/><strong>三、X:nth-of-type(n)</strong><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">ul:nth-of-type(3)&nbsp;{<br/>border:&nbsp;1px&nbsp;solid&nbsp;black;<br/>}</div></div><br/>　　nth-of-type与nth-child的效果是惊人的相似，想要更多的了解nth-of-type请看《Alt&#101;rnative&nbsp;for&nbsp;:nth-of-type()&nbsp;and&nbsp;:nth-child()》，:nth-of-type(N)<br/><br/><strong>四、X:nth-last-of-type(n)</strong><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">ul:nth-last-of-type(3)&nbsp;{<br/>border:&nbsp;1px&nbsp;solid&nbsp;black;<br/>}</div></div><br/>　　:nth-last-child效果相似。<br/><br/><strong>五、X:first-child</strong><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">ul&nbsp;li:first-child&nbsp;{<br/>border-top:&nbsp;none;<br/>}</div></div><br/>　　匹配子集的第一个元素。IE7就可以支持了，这个伪类还是非常有用的。<br/><br/><strong>六、X:last-child</strong><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">ul&nbsp;&gt;&nbsp;li:last-child&nbsp;{<br/>color:&nbsp;green;<br/>}</div></div><br/>　　与:first-child效果相反<br/>　　留意IE8支持:first-child,但不支持:last-child。<br/><br/><strong>七、X:only-child</strong><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">div&nbsp;p:only-child&nbsp;{<br/>color:&nbsp;red;<br/>}</div></div><br/>　　　这个伪类一般用的比较少，比如上述代码匹配的是div下的有且仅有一个的p，也就是说，如果div内有多个p，将不匹配。<br/><br/><strong>八、X:only-of-type</strong><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">li:only-of-type&nbsp;{<br/>font-weight:&nbsp;bold;<br/>}</div></div><br/>　　与:only-child类似。<br/><br/><strong>九、X:first-of-type</strong><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">ul:first-of-type{<br/>font-weight:&nbsp;bold;<br/>}</div></div><br/>　　等价于:nth-of-type(1)，匹配集合元素中的第一个元素。<br/>　　]]></description>
		</item>
		
			<item>
			<link>http://www.52css.com/default.asp?id=1187</link>
			<title><![CDATA[再说四种CSS伪类选择器]]></title>
			<author>MrJin@52css.com(52css)</author>
			<category><![CDATA[CSS2.0教程]]></category>
			<pubDate>Sat,18 Dec 2010 20:52:26 +0800</pubDate>
			<guid>http://www.52css.com/default.asp?id=1187</guid>	
		<description><![CDATA[　　我们在前面的文章中，陆续为大家讲了十七种CSS选择器。<br/>　　五种必须知道的CSS选择器&nbsp;<br/>　　<a target="_blank" href="http://www.52css.com/article.asp?id=1181">http://www.52css.com/article.asp?id=1181</a><br/>　　还需要学习的十二种CSS选择器<br/>　　<a target="_blank" href="http://www.52css.com/article.asp?id=1182">http://www.52css.com/article.asp?id=1182</a><br/>　　今天和大家一起学习下面的四种伪类，知则加深印象，不知则努力学之。<br/><br/><strong>一、X:after</strong><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">.clearfix:after&nbsp;{<br/>content:&nbsp;“”;<br/>display:&nbsp;block;<br/>clear:&nbsp;both;<br/>visibility:&nbsp;hidden;<br/>font-size:&nbsp;0;<br/>height:&nbsp;0;<br/>}&nbsp;<br/>.clearfix&nbsp;{<br/>*display:&nbsp;inline-block;<br/>_height:&nbsp;1%;<br/>}</div></div><br/>　　我想上面这段代码，很多朋友都非常熟悉，是清理浮动时常用的hack方法。:after伪类与content结合使用，用于往元素类追加内容。:after伪类还有个妙用：用于产生阴影，点击这里查看。<br/><br/><strong>二、X:hover</strong><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">div:hover&nbsp;{<br/>background:&nbsp;#e3e3e3;<br/>}</div></div><br/>　　hover在52CSS.com前面的文章中已经介绍过，IE6下只支持a的hover。<br/>　　即使用border-bottom:&nbsp;1px&nbsp;solid&nbsp;black;&nbsp;要好于text-decoration:&nbsp;underline;<br/>　　从实际的效果来看，使用border-bottom的距离比text-decoration来的合理，但使用border-bottom存在一些风险，比如颜色问题。<br/><br/><strong>三、X:not(sel&#101;ctor)</strong><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">div:not(#container)&nbsp;{<br/>color:&nbsp;blue;<br/>}</div></div><br/>　　否定伪类选择器，这还是比较好理解的，上述将会把非id为container的div的字体颜色设置为蓝色。<br/>　　:not伪类IE8并不支持，IE9已经支持了。<br/><br/><strong>四、X::pseudoElement</strong><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">p::first-line&nbsp;{<br/>font-weight:&nbsp;bold;<br/>font-size:&nbsp;1.2em;<br/>}</div></div><br/>　　::伪类，用于给元素的片段添加样式，这如何理解呢？比如你要让一个段落的第一行的文字加粗，那么这个选择器是不二之选。<br/>　　除此之外，你还可以给第一个字加上特殊样式，这个应用还是非常常见的<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.52css.com/images/quote.gif" style="margin:0px 2px -3px 0px" alt="div css xhtml xml Example Source Code"/> Example Source Code <span style="font-weight:100;color:#f7f7f7;">[www.52css.com]</span></div><div class="UBBContent">p::first-letter&nbsp;{<br/>float:&nbsp;left;<br/>font-size:&nbsp;2em;<br/>font-weight:&nbsp;bold;<br/>font-family:&nbsp;cursive;<br/>padding-right:&nbsp;2px;<br/>}</div></div><br/>　　IE6居然支持！这足以让人惊喜……的欢唱！未完待续，52CSS近日继续推出关于选择器的文章。]]></description>
		</item>
		
</channel>
</rss>
