﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-杨的空间-文章分类-WEB标准相关(DIV+CSS)</title><link>http://www.cnitblog.com/yhf119/category/1260.html</link><description>业精于勤，荒于嬉，行成于思，毁于随</description><language>zh-cn</language><lastBuildDate>Mon, 26 Sep 2011 10:36:28 GMT</lastBuildDate><pubDate>Mon, 26 Sep 2011 10:36:28 GMT</pubDate><ttl>60</ttl><item><title>CSS 锦囊</title><link>http://www.cnitblog.com/yhf119/articles/5338.html</link><dc:creator>杨</dc:creator><author>杨</author><pubDate>Tue, 13 Dec 2005 08:06:00 GMT</pubDate><guid>http://www.cnitblog.com/yhf119/articles/5338.html</guid><wfw:comment>http://www.cnitblog.com/yhf119/comments/5338.html</wfw:comment><comments>http://www.cnitblog.com/yhf119/articles/5338.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yhf119/comments/commentRss/5338.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yhf119/services/trackbacks/5338.html</trackback:ping><description><![CDATA[<H4>最后更新：2004.03.05</H4>
<P>翻译：<STRONG><A href="http://www.onestab.net/">onestab</A></STRONG> [2004.03.09] <BR>原文：mezzoblue <A title="css crib sheet at mezzoblue.com" href="http://www.mezzoblue.com/css/cribsheet/">CSS Crib Sheet</A> </P>
<P>在使用CSS建站时，您肯定遇到过形形色色的布局问题，最后可能被搞得焦头烂额。本文的目的是让您的设计过程更为容易，当您遇到困难时为您提供快速参考。</P>
<P>如果您有所补充，<A title="CSS Crib Sheet Archive" href="http://www.mezzoblue.com/archives/2003/11/25/css_crib_she/">请在这里发表您的意见</A>.</P>
<P>本文的其他语言版：<A title=French href="http://www.shinze.com/index.php/2003/11/28/40-LesBonsConseilsDePappyDave">法语</A>, <A title=Deutsch href="http://css-technik.de/details/206/8/Tutorials-CSS.htm">德语</A>, <A title=Spanish href="http://www.yatienesweb.info/corporativo/index.php?option=articles&amp;task=viewarticle&amp;artid=15&amp;Itemid=3">西班牙语</A> 和 <A title=Magyar href="http://js.hu/web/csscribsheet.html">匈牙利语</A>。 欢迎提供其他翻译。</P>
<DL title="CSS 锦囊">
<DT id=validate><STRONG>有疑问，先验证</STRONG> 
<DD>在调试时，先对您的代码进行验证往往能省去不少麻烦事。格式不正确的<ACRONYM title="eXtensible HyperText Markup Language">XHTML</ACRONYM>/CSS 会导致许多布局上的错误。 
<DT id=advanced><STRONG>在其他浏览器中进行测试<EM>之前</EM>，请先在最先进的浏览器中撰写和测试CSS代码，而不是相反。</STRONG> 
<DD>如果您在破旧的浏览器中编写和测试，你的代码就不得不依赖那个破旧浏览器的糟糕的显示，然后在符合标准的浏览器中进行测试，看到显示结果“不正常”时，你会很沮丧的。相反，您应该先将您的代码完善，然后再设法为较低级的浏览器打算。这样从一开始您的代码就是符合标准的，你不必再为支持其他浏览器而劳心费神。当然了，目前遵从标准的浏览器无疑就是 Mozilla, Safari 或 Opera。 
<DT id=exist><STRONG>确保您想要的效果真的存在 </STRONG>
<DD>许多特定的浏览器专有的CSS扩展在<A title="CSS2 标准" href="http://www.w3.org/TR/CSS2/">正式标准</A>中并不存在。 如果您对 <CODE><FONT color=#000099>filter(滤镜)</FONT></CODE> 或滚动条指定样式，您用的就是私有代码，除了<ACRONYM title="Internet Explorer">IE</ACRONYM>之外，在别的浏览器中毫无作用。如果验证器告诉您代码没有定义，极有可能您用了私有样式，别指望在不同的浏览器中得到一致的效果。 
<DT id=floats><STRONG>如果布局中一定要用浮动对象，别忘了适时使用清除（clear）属性。</STRONG> 
<DD>浮动元素似易实难，而且难以驾驭。如果您发现浮动对象伸出了容器的边界，或者不像您所期望的那样显示，请检查您的期望是否正确。关于这个问题请看<A title=浮动的包容 href="http://www.complexspiral.com/publications/containing-floats/">Eric Meyer 的教程</A> 
<DT id=margins><STRONG>边距的合并：可用padding 或 border 来避免。</STRONG> 
<DD>您可能被多余的(或者想要却不出现的)空白搞得焦头烂额。如果您用了 margins，边距的合并可能就是问题的根源。 <A title="No Margin for Error" href="http://www.andybudd.com/blog/archives/000114.html">Andy Budd</A> 对此的解释也许能为你解惑。 
<DT id=boxmodel><STRONG>避免将 padding/border <EM>和</EM>固定宽度同时应用到同一元素。</STRONG> 
<DD>IE5 错误的区块模型是罪魁祸首，是它把事情弄得乱七八糟。虽然有<A title="Box Model Hack" href="http://tantek.com/CSS/Examples/boxmodelhack.html">补救方案</A>，不过最好是绕过这个问题，当子元素的宽度固定时，为其父元素指定padding。 
<DT id=fouc><STRONG>避免IE下未指定样式内容的闪烁。</STRONG> 
<DD>如果您用 <CODE><FONT color=#000099>@import</FONT></CODE> 来输入外部样式表，早晚会发现IE有“闪烁”的毛病。在应用CSS样式之前，未格式化的<ACRONYM title="HyperText Markup Language">HTML</ACRONYM>文本会短暂地出现。<A title="Flash of Unstyled Content (FOUC)" href="http://www.bluerobot.com/web/css/fouc.asp">这是可以避免的</A>. 
<DT id=min-width><STRONG>别指望 <CODE><FONT color=#000099>min-width</FONT></CODE> 在IE中有用。</STRONG> 
<DD>IE不支持它，但是它将 <CODE><FONT color=#000099>width</FONT></CODE> 当作 <CODE><FONT color=#000099>min-width</FONT></CODE>，所以通过一些 IE 的过滤技巧(filtering)，可以实现同样的最终效果。 
<DT><STRONG>走投无路时，试一试减少宽度</STRONG> 
<DD>由于舍入误差，有时 50% 加上 50% 等于 100.1%，破坏某些浏览器中的布局。不妨试试将 50% 减到 49%，甚至 49.9%。 
<DT><STRONG>IE 中显示不正常？</STRONG> 
<DD>可能是 Peekaboo 臭虫在作怪，尤其是当鼠标经过超链接时能显示正常。修补方法见<A href="http://www.positioniseverything.net/explorer/peekaboo.html">Position is Everything</A>。 
<DT id=anchors><STRONG>如果使用了锚点，在应用超链接样式时要特别小心。</STRONG> 
<DD>如果您在代码中使用了传统的锚点(<CODE><FONT color=#000099>&lt;a name="anchor"&gt;</FONT></CODE>)，您会注意到 <CODE><FONT color=#000099>:hover</FONT></CODE> 和 <CODE><FONT color=#000099>:active</FONT></CODE>伪类也会作用于它。要避免这种情形，你可以使用 <CODE><FONT color=#000099>id</FONT></CODE>，或者使用<A title="Notes on suggesting link styles" href="http://dbaron.org/css/1999/09/links">鲜为人知的</A>语法: <CODE><FONT color=#000099>:link:hover, :link:active</FONT></CODE> 
<DT id=lovehate><STRONG>记住“LoVe/HAte”（爱/恨）链接规则</STRONG> 
<DD>要以下面的顺序指定超链接伪类：Link, Visited, Hover, Acitve。任何其他顺序都不妥当。假如用了 <CODE><FONT color=#000099>:focus</FONT></CODE>，次序应为 LVHFA(“Lord Vader's Handle Formerly Anakin”，<A href="http://a.wholelottanothing.org/">Matt Haughey</A>这样建议)。 
<DT id=troubled><STRONG>请记住“TRouBLED”（麻烦的）边框。</STRONG> 
<DD>边框(border)、边距(margin)和补白(padding)的简写次序为：顺时针方向从上开始，即 Top, Right, Bottom, Left。比如 <CODE><FONT color=#000099>margin: 0 1px 3px 5px;</FONT></CODE>表示上边距为零，右边距为1px，依此类推。 
<DT id=units><STRONG>非零值要指明单位。</STRONG> 
<DD>在用CSS指定字体、边距或大小时，必须指明所用的单位（唯一的例外是 <CODE><FONT color=#000099>line-height</FONT></CODE>，很奇怪，它不需要单位）。某些浏览器对未指明单位的处理方法不足为凭。零就是零，不管是 px 还是 em。其他的非零值都要明确指定单位。例如：<CODE><FONT color=#000099> padding: 0 2px 0 1em;</FONT></CODE> 
<DT id=fontsizes><STRONG>测试不同的字体大小。</STRONG> 
<DD>像 Mozilla 和 Opera 这样的高级浏览器都允许你改变字体大小，不管你用什么字体单位。某些用户的默认字体大小肯定和你的不同，尽最大努力去满足他们。 
<DT id=embed><STRONG>测试时用嵌入式样式，发布时再改为外部输入。</STRONG> 
<DD>将样式表嵌入在你的 HTML 源代码中，在测试时可以消除许多缓存引起的错误，尤其是某些 Mac 下的浏览器。但在发布前，一定要记住将样式表移到外部文件，用 <CODE><FONT color=#000099>@import</FONT></CODE> 或 <CODE><FONT color=#000099>&lt;link&gt;</FONT></CODE>引入。 
<DT id=addborders><STRONG>加上明显的边框有助于布局调试。</STRONG> 
<DD>像 <CODE><FONT color=#000099>div {border: solid 1px #f00;}</FONT></CODE> 之类的全局规则可以暂时为你查出布局问题。为特定的元素加上边框可帮您找到难以发觉的重叠或空白问题。 
<DT id=paths><STRONG>图片路径不要用单引号。</STRONG> 
<DD>当设置背景图片时，要坚持用双引号。尽管看起来好像多此一举，但是如果不这么做，IE5/<ACRONYM title=Macintosh>Mac</ACRONYM> 会噎住。 
<DT id=emptylinks><STRONG>不要为将来的样式表（比如手持式设备或打印用样式表）“占位子”。</STRONG> 
<DD>Mac IE5 对空的样式表比较感冒，会增加页面的装入时间。建议样式表中至少应该有一条规则（哪怕是注释也好），免得 MacIE噎住。 </DD></DL>
<P>还有一些建议虽然不针对某些功能，但是在开发过程中值得注意：</P>
<DL title=有益的CSS理论>
<DT id=organize><STRONG>好好组织您的CSS文件</STRONG> 
<DD>恰当地成块注释CSS，将相似的CSS选择符编为一组，养成一致的命名习惯和空白格式（为跨平台考虑，建议用空白字符而不是tab。）以及适当的次序。 
<DT id=names><STRONG>以功能（而不是外观）为类和ID命名</STRONG> 
<DD>假如您创建了一个 <CODE><FONT color=#000099>.smallblue</FONT></CODE> 类，后来打算将文字改大，颜色变为红色，这个类名就不再有任何意义了。相反，您可以用更有描述性的名字如 <CODE><FONT color=#000099>.copyright</FONT></CODE> 和 <CODE><FONT color=#000099>.pullquote</FONT></CODE>。 
<DT id=combine><STRONG>组合选择符</STRONG> 
<DD>保持CSS短小对减少下载时间非常重要。请尽量为选择符<A href="http://www.w3.org/TR/CSS1#grouping">分组</A>、 利用<A href="http://www.w3.org/TR/CSS1#inheritance">继承(inheritance)</A>以及使用<A href="http://www.w3.org/TR/CSS1#margin">简写(shorthand)</A>来减少冗余。 
<DT id=imagereplacement><STRONG>使用图片替换技术时要考虑亲和力</STRONG> 
<DD>已经发现<A title="Using background-image to Replace Text" href="http://www.stopdesign.com/also/articles/replace_text/">传统的FIR</A>在屏幕阅读器，以及关闭图片显示[的浏览器]中会出问题。 对此有<A title="Revised Image Replacement" href="http://www.mezzoblue.com/tests/revised-image-replacement/">其他解决办法</A>，要根据具体情况，慎重使用。 </DD></DL><img src ="http://www.cnitblog.com/yhf119/aggbug/5338.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yhf119/" target="_blank">杨</a> 2005-12-13 16:06 <a href="http://www.cnitblog.com/yhf119/articles/5338.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>绝对定位的臭虫（Going Absolutely Buggy）</title><link>http://www.cnitblog.com/yhf119/articles/5337.html</link><dc:creator>杨</dc:creator><author>杨</author><pubDate>Tue, 13 Dec 2005 07:45:00 GMT</pubDate><guid>http://www.cnitblog.com/yhf119/articles/5337.html</guid><wfw:comment>http://www.cnitblog.com/yhf119/comments/5337.html</wfw:comment><comments>http://www.cnitblog.com/yhf119/articles/5337.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yhf119/comments/commentRss/5337.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yhf119/services/trackbacks/5337.html</trackback:ping><description><![CDATA[<H1>绝对区块里的绝对区块 </H1><!-- start of demo -->
<DIV id=container>
<DIV id=leftbox>
<DIV id=innerleft></DIV></DIV>
<DIV id=rightbox>
<DIV id=innerright></DIV></DIV>
<DIV id=content-area></DIV></DIV><!-- end of demo --><IMG id=moz height=80 src="http://www.onestab.net/a/pie/images/Moz1.gif" width=80> 
<DIV id=mozcaption>Mozilla 1,<BR>IE5/Mac,<BR>Opera 7 </DIV><IMG id=ie height=80 src="http://www.onestab.net/a/pie/images/IE5.5.gif" width=80> 
<DIV id=iecaption>IE5.5/Win<BR>IE6/Win </DIV><IMG id=op6 height=80 src="http://www.onestab.net/a/pie/images/Op6.gif" width=80> 
<DIV id=opcaption>Op6/Win<BR>Op6/mac </DIV><IMG id=omni height=82 src="http://www.onestab.net/a/pie/images/omniweb.gif" width=42> 
<DIV id=omnicaption>Omniweb<BR><BR>跟 Opera 6 有得一比 </DIV>
<DIV id=rightcol>
<P class=alignright><A href="http://www.onestab.net/a/pie/index.html"><STRONG><FONT color=#000000>返回 p.i.e.</FONT></STRONG></A> </P>
<H3>范例</H3>
<P>这篇是拿绝对定位(absolute positioning)当题材。div#container（棕色粗框）是用“left”和“top”定位，并有着相等的高度和宽度(80px)。它包含两个绝对区块（黑色和绿色边框）、一个以固定(static) div 表示的内容区域（灰色区块），而且也设定了补白（环绕着灰色区块的淡蓝色部分）。 <STRONG>注意：</STRONG>如果没有修正 div#container 的尺寸，浏览器的表现就相差很大。如果想知道更详细的信息，请参考 <A href="http://www.onestab.net/a/pie/abs_relbugs.html"><FONT color=#000000>绝对定位的臭虫 II</FONT></A>。 </P>
<P>绿色和黑色边框的区块是分别为 top/left 和 bottom/right 套用“0px”，使它们位于相对的角落。它们也分别包了一个用同样方式定位的小区块。所有的区块都是正方形的，而且都套用了 Tantek 的技巧（针对 IE5.x 区块模型的错误，请参考源文件）。 </P>
<P>其下是这个范例的几个屏幕截图(screenshot)。 </P>
<H3>表现</H3>
<P>想当然地，这个范例对较早期的浏览器来说很困难。 </P>
<P>强大的 Gecko 引擎(Moz, Nav6/7)表现得毫无瑕疵。 IE5/Mac 和 Mozilla 一样有着完美的表现。Opera 7 也能正确显示。 </P>
<P>以 IE 的表现来说，IE/Win 算是不错了。但注意到那些被垂直拉长的小区块了吗？这表示 IE 不允许这些绝对区块的“高度(height)”小于“行高(line-height)”。然而这只针对那些大区块或小区块。中等尺寸的区块却很神奇地可以使用“height:0px”。 </P>
<P>不过这个臭虫几乎不会影响到页面，而不像 Opera 6 那么严重。 </P>
<H3>老天！我的背又在痛了！</H3>
<P>请注意，在 Opera 6 里黑色和绿色边框区块加总起来所占的尺寸，会正好等于灰色内容区域的大小。（！）看来 Opera 绘制范例的方法是先放置好容器(container)，但不设定任何补白或边框，并依此放置被包着的绝对区块。直到最后才把补白跟边框套用在容器区块上，让它们往右下方延伸，<EM>却不去动那些被包着的区块</EM>。图中的小区块也有一样的状况。 </P>
<P>这是个大问题（如果你在乎 Opera 6 的话）。别以为你可以用 div 容器(wrapper)做修正，这个臭虫也会感染 div。 </P>
<H3>修正</H3>
<P>别在这种容器上使用边框或补白。如果你坚持这么做，可以把一个绝对定位的 div 放在容器的上方或下方，以提供替代的边框或补白。</P>
<P>有个非常令人振奋的消息，Opera 7已经修正了这个问题，并且在绝对定位上有非常好的表现。请朝着挪威的方向行三鞠躬礼。 </P>
<H3>呜呼</H3>
<P>用 Op7.1 的可能会注意到范例中的灰色区域不见了，取代它的是一个嵌套的 div 背景。 <A href="http://www.designdetector.com/"><STRONG><FONT color=#000000>Chris Hester</FONT></STRONG></A> 向我指出了这一点，关于最新的 Opera 臭虫请看 <A href="http://www.onestab.net/a/pie/op-omnibus/boxbug.html"><STRONG><FONT color=#000000>这个页面</FONT></STRONG></A>。 </P>
<P class="small alignright">原作者:<BR><A title=" Holly 'n John's Tableless Design and Repair " href="http://www.positioniseverything.net/design/"><STRONG><FONT color=#000000>Holly 'n John</FONT></STRONG></A> &nbsp; <A title=" If you've found something new and interesting to say about this,&#10;or any CSS subject, please contact me. I want to know! " href="mailto:johnthebig66@yahoo.com"><FONT color=#000000>Contact me</FONT></A> ©positioniseverything<BR>最后修订: May11, 2003<BR>写于 June 2, 2002 </P>
<P class="small alignright"><A title="" href="http://ccca.nctu.edu.tw/~hlb/trans/pie/posbugs.html"><FONT color=#000000>繁体中文翻译：</FONT></A><STRONG>lincc</STRONG><BR>简体中文翻译:<A href="http://www.onestab.net/"><STRONG><FONT color=#000000>onestab</FONT></STRONG></A> </P><BR></DIV><img src ="http://www.cnitblog.com/yhf119/aggbug/5337.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yhf119/" target="_blank">杨</a> 2005-12-13 15:45 <a href="http://www.cnitblog.com/yhf119/articles/5337.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>IE 浮动模型的 Bug</title><link>http://www.cnitblog.com/yhf119/articles/5336.html</link><dc:creator>杨</dc:creator><author>杨</author><pubDate>Tue, 13 Dec 2005 07:44:00 GMT</pubDate><guid>http://www.cnitblog.com/yhf119/articles/5336.html</guid><wfw:comment>http://www.cnitblog.com/yhf119/comments/5336.html</wfw:comment><comments>http://www.cnitblog.com/yhf119/articles/5336.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yhf119/comments/commentRss/5336.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yhf119/services/trackbacks/5336.html</trackback:ping><description><![CDATA[<P class=alignright><EM>这篇文章是 Holly Bergevin 和我最初为<A href="http://www.communitymx.com/"><STRONG>CommunityMX 网站</STRONG></A> 写的，该网站资源丰富，论坛里高手云集，不过需要订阅。</EM> </P>
<P>如果用表格布局，Internet Explorer 的表现和别的浏览器并无二致。但是如果用 CSS 来定位时， IE 表现得相当怪异。其中之一就是他对浮动的处理方式。 </P>
<H3>IE 到底如何与众不同？</H3>
<P>要理解浮动模型，首先要弄清当浮动元素后面紧跟有非浮动元素时的行为。如浮动理论所说，紧跟在浮动元素之后的区块元素会无视该浮动元素的存在，显示在与浮动元素完全相同的位置上。浮动元素蒙在区块元素之上，该区块元素（假设没有指定其宽度）将横跨整个浏览器的视区或所在的容器宽度。 </P>
<P class=tip>为了使元素显示在浮动元素的旁边，浮动元素<STRONG>必须</STRONG>在这些元素的前面。如果浮动元素紧跟在非浮动元素之后，它将出现在这些非浮动元素的正<STRONG>下方</STRONG>。 </P>
<P>当这种情况出现时（浮动元素后面紧跟区块元素），W3C的标准中说，区块元素必须显示在容器的顶部。现代浏览器对此都能正确执行。如图所示： </P>
<P>浅棕色的 div 紧跟在顶部，前面的绿色浮动块蒙在它的上面。按照标准，以深蓝色条纹表示的的行不允许出现在浮动块的背后。 </P><PRE class=code>&lt;div style="float:left; width:30%;"&gt;
浮动区块内容。
&lt;/div&gt;

&lt;p&gt;段落&lt;/p&gt;
</PRE>
<P class=float-p><IMG height=100 alt="浮动块和 div 的相互关系的图片" src="http://www.onestab.net/a/pie/articles/images/float1.gif" width=188> 请留意，之后的区块元素会伸展到整个容器的宽度，浮动元素只是覆盖在其上面。 <A href="http://www.w3.org/TR/REC-CSS2/visuren.html#comparison">W3C 标准</A>规定，每行（包括文本和图片）必须显示在段落内未被浮动元素遮住的区域。同样，现代浏览器也符合这个标准。 </P>
<P>一切都很正常，但是如果为区块元素指定了 <STRONG>width</STRONG> (或 <STRONG>height</STRONG>)，情况就大不一样了。一旦指定了尺寸，IE 处理浮动元素的方式就发生了巨大的变化。 </P>
<H3>错在哪里</H3>
<P>我们不妨为区块元素指定 <SPAN class=inlineimp>{width: 100%;} </SPAN>。 在大多数的现代浏览器中，结果不会有什么变化，因为 "100%" 指的是整个容器的宽度。不幸的是 IE 可不这么想。 </P>
<P>在 IE 中，<SPAN class=inlineimp> {width: 100%;} </SPAN>被<EM>重新解释为</EM> 浮动元素侧面所剩余的宽度，而不是标准中所说的整个容器的宽度。此外， 如果左边有浮动元素，则区块元素从它的<EM>右面</EM> 开始显示，如果右面有浮动元素，则区块元素从它的<EM>左边</EM>开始显示。而标准规定，无论是否存在浮动元素， dvi 都应该从视区的最左边开始显示。 </P>
<P>总之，任何紧跟在浮动元素后面的区块元素，如果指定了它的高度或宽度， <EM style="COLOR: #666">在 IE 中观看时</EM>就会成这样。下图就是 IE 的显示，请与上图标准所要求的效果对照。 </P><PRE class=code>&lt;div style="float:left; width:30%;"&gt;
浮动区块内容。&lt;/div&gt;

&lt;p&gt;段落&lt;/p&gt;
 
&lt;p style="width:100%;"&gt;Paragraph&lt;/p&gt;
</PRE>
<P class=float-p><IMG height=100 alt="IE 浮动块和 div 的相互关系" src="http://www.onestab.net/a/pie/articles/images/float2.gif" width=188> 还记得，浮动元素背后的文本行应该被移出来。如果浮动元素比区块元素高，很难看出 IE 中没有把浮动元素盖在区块元素之上。如果区块元素没有边框和背景色，更难以察觉到这个变化。 </P>
<P class=tip style="CLEAR: both">如果浮动元素<STRONG>不是</STRONG>图片，则在 IE 下，两个元素之间会有 3 个像素的间隙，不过这个 IE 独有的问题将另文讨论。 </P>
<H3>IE 本身也不一致</H3>
<P class=float-p-r><IMG height=231 alt="" src="http://www.onestab.net/a/pie/articles/images/two-way.gif" width=282> 如果说有浮动元素存在时，IE 对已指定尺寸的段落的宽度计算有误的话，更为难以想象的是 <STRONG>只要没有浮动元素</STRONG>，它却将同一页面内的另一个段落的宽度计算成整个容器的宽度。 </P>
<P>图中显示的是IE 中一个浮动元素之后紧接两个 <SPAN class=inlineimp>{width:100%;} </SPAN>的段落，唯一的区别就是第一个段落在浮动元素的旁边，而第二个却不。所以即使不考虑它的错误，我们也无法指望 IE 的行为前后一致。 </P>
<P>确实令人心烦。如果宽度不是100%，或者用其他单位来指定区块的宽度，情况更为糟糕。 </P>
<H3>现实的问题</H3>
<P>OK，假如一个新手想用浮动来实现两个分栏的布局，他想要的就是两个简单、分离的栏目直到页低，这不算过分吧。在 Netscape 4 下的一个可行方案是为左边的栏目指定<SPAN class=inlineimp>&nbsp;{float:left;}&nbsp;</SPAN>的样式，后面的区块从浮动块的右边直落下去。 </P>
<P>假定浮动块的样式为<SPAN class=inlineimp>&nbsp;{width:50%;}&nbsp;</SPAN>，为了将两个分栏垂直对齐，并将边框和背景区分开来，他将非浮动的分栏的左边距(left margin)设置为 "60%"，右边距大概为 "5%"。浮动分栏也有一个左边距，离开左边一些。该代码的确可以创建两个简洁的肩并肩的分栏（见图）。 </P><PRE class=code>&lt;div style="float:left; width:50%; margin-left:5%;"&gt;
Content in float.
&lt;/div&gt;

&lt;p style="margin-left:60%; margin-right:5%;"&gt;
Paragraph
&lt;/p&gt;
</PRE>
<P class=float-p><IMG height=137 alt="IE 中看到的两个分栏" src="http://www.onestab.net/a/pie/articles/images/float3.gif" width=225> 在 IE 下没有问题。但通常情况下，新手会为区块元素指定一个宽度。不幸的是，只有将后面的段落的<STRONG>width</STRONG> 设定为 <STRONG>70%</STRONG>左右，才能在 IE 中看起来舒服一些。浮动分栏不但需要左边距，而且还要有右边距（或者为右边分栏指定一个左边距），将右边的分栏推开一些。 </P>
<P>现在这个新手终于高兴地得到了两个分栏。怎么不会呢？这种效果很容易实现，他所见到的就是他想要的。 不过他高兴得太早了。 </P>
<P class=float-p-r><IMG height=150 alt="非 IE 浏览器中看到的两个分栏" src="http://www.onestab.net/a/pie/articles/images/float4.gif" width=225> 如果在一个真正遵守标准的浏览器（不是IE）观看这个布局，区块元素（根据标准）会从<STRONG>视区的左边</STRONG>开始，并且宽度只有 70%，在右边留下了 30% 的空白。真是糟糕，如果区块元素仅比浮动元素宽一点，浮动区块旁边蓝色条纹所表示的文本就会被挤得更短。而浮动区块的左边距又使得文本变得更短。如此一来，这些极短的行就使行数增加，从而增加了区块元素的高度，文字就会显示在浮动元素的下方，填满这个总宽度为70%的分栏，完全破坏了在非IE浏览器下的外观。令人怀疑这就是微软的用意？ </P>
<P>如果浮动元素和区块元素的宽度相同或者更宽，则文字<STRONG>根本不会</STRONG>显示在旁边，而是全部被推倒了浮动元素的下方。这根本不是所希望的结果。 </P>
<H3>IE6 的新变化</H3>
<P>现在我们已经知道，<STRONG>IE 6</STRONG>甚至连这个糟糕的浮动模型也不再遵守了。所以我们以上所说的目前只针对<STRONG>IE 5.x/win</STRONG> 而不是 <STRONG>IE 6</STRONG>。IE6 和 IE5.x 一样，仍然错误地计算浮动区块旁边的段落起始位置，可是它正确地将 {width: 100%;} 看成是外部容器的整个宽度，这一点和其他遵守标准的浏览器一致。 </P>
<P>让我们来设想一下。一个段落的宽度是100%，但是从一个浮动元素的<STRONG>后面</STRONG>开始。 100% <STRONG>加上</STRONG>浮动元素的宽度会略大于容器的宽度！如果容器是 body 元素，就会出现水平滚动条。 </P>
<P>可以肯定的是，如果有人没有在 IE 浏览器下设计种浮动布局（指定区块元素的宽度），而在 IE 下观看时这种布局很容易错乱，在我看来这并不奇怪。如果倒过来，情况反而会更糟。 </P>
<H3>运用浮动的一些建议</H3>
<P>对紧跟在浮动元素后面的元素不要制定宽度或高度。当然这意味着如果想实现独立的分栏，必须为区块元素指定一个左边距。很不幸者这又带来了 IE 下另一个缺憾。还记得我以前提到过的IE中 "3个像素" 的 bug吗？就是它。 </P>
<H3>结论</H3>
<P>人们很容易注意到区块模型问题，而且最后得以修正。但是这个问题也同样严重。没有迹象表明微软会关注它，甚至根本不愿承认这个问题。 何苦呢？实际上根本没有人知道这个问题！ </P>
<P>采用 CSS 定位非常有利于减少下载时间、简化网站设计更新和改进站点的亲和力，但是作为最广泛使用的浏览器， Internet Explorer 使之变得非常困难。但愿这种违背标准的行为总有个尽头。 </P><BR>
<P class="small alignright"><A title="Holly 和 John 的无表格布局和修正" href="http://www.positioniseverything.net/design/"><STRONG>Holly 'n John</STRONG></A> &nbsp; <A title="If you've found something new and&#10;interesting to say about any CSS subject, please contact me. I want to know! " href="mailto:johnthebig66@yahoo.com">e-mail</A> ©positioniseverything<BR>最后更新：January 18, 2004<BR>写于 July 21, 2003 <BR>中文翻译：<STRONG>onestab</STRONG> Jan 30, 2004 </P><img src ="http://www.cnitblog.com/yhf119/aggbug/5336.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yhf119/" target="_blank">杨</a> 2005-12-13 15:44 <a href="http://www.cnitblog.com/yhf119/articles/5336.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>浮动模型问题 The Float Model Problem</title><link>http://www.cnitblog.com/yhf119/articles/5335.html</link><dc:creator>杨</dc:creator><author>杨</author><pubDate>Tue, 13 Dec 2005 07:43:00 GMT</pubDate><guid>http://www.cnitblog.com/yhf119/articles/5335.html</guid><wfw:comment>http://www.cnitblog.com/yhf119/comments/5335.html</wfw:comment><comments>http://www.cnitblog.com/yhf119/articles/5335.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yhf119/comments/commentRss/5335.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yhf119/services/trackbacks/5335.html</trackback:ping><description><![CDATA[<H1>浮动模型的问题<BR>（The<BR>Float Model<BR>Problem）</H1>
<DIV id=float>&nbsp;</DIV>
<DIV id=static>&nbsp;</DIV>
<DIV style="CLEAR: both">&nbsp;</DIV>
<DIV id=screenshots><STRONG><SPAN>Moz/N7 与 Opera 6/7.1, Windows</SPAN><BR><IMG alt="" src="http://www.onestab.net/a/pie/images/floatmodel-op6-moz.gif"><BR></STRONG><SPAN><STRONG>Internet Explorer 5.5, Windows<BR>（区块模块的尺寸不对<BR>且有 3px 的 </STRONG><A title=" IE bug closely related to this one " href="http://www.onestab.net/a/pie/explorer/threepxtest.html"><FONT color=#000000><STRONG>bug-space</STRONG></FONT></A><STRONG>）</STRONG></SPAN><BR><STRONG><IMG alt="" src="http://www.onestab.net/a/pie/images/floatmodel-IE5.5.gif"><BR></STRONG><STRONG><SPAN>Internet Explorer 6, Windows<BR>（显示 3px bug-space）</SPAN><BR><IMG alt="" src="http://www.onestab.net/a/pie/images/floatmodel-IE6.gif"><BR></STRONG><SPAN><STRONG>Internet Explorer 5, Mac<BR>（显示 IE5/mac </STRONG><A title=" Philippe Wittenbergh's excellent Mac site " href="http://www.l-c-n.com/IE5tests/float/index.shtml"><FONT color=#000000><STRONG>float/div&nbsp;bug</STRONG></FONT></A><STRONG>）</STRONG></SPAN><BR><STRONG><IMG alt="" src="http://www.onestab.net/a/pie/images/floatmodel-IE5-mac.gif"><BR><SPAN>Opera 7, Windows</SPAN><BR><IMG alt="" src="http://www.onestab.net/a/pie/images/floatmodel-op7.gif"><BR></STRONG></DIV>
<DIV id=textcol>
<UL>
<LI><A href="http://www.onestab.net/a/pie/index.html"><STRONG><FONT color=#000000>返回 p.i.e.</FONT></STRONG></A> 
<LI><A href="http://www.onestab.net/a/pie/ordered-floats.html#float-model"><STRONG><FONT color=#000000>返回“依原始码顺序排列的栏段”</FONT></STRONG></A> </LI></UL>
<H2>什么是浮动模型？</H2>
<P>好的，我们要针对固定(static)元素与浮动(float)元素如何互动做个测试。根据 W3C 的规定，当浮动元素后面紧跟着固定元素（在一般的布局流下）时，浮动元素会以包含浮动元素的对象（在此是“body”元素）的左侧作为显示区块的基准，固定元素也会套用相同的基准，并且与浮动元素处在相同的重直高度。 </P>
<P>除非固定元素设定左边界(margin)让自己往右边靠，而不被浮动元素挡住，否则浮动元素应该会覆盖住固定元素。你也可以利用 clear:left 或 clear:both 等属性来“清除”固定元素，让固定元素放置在浮动元素的下层。 </P>
<H2>测试细节</H2>
<P>如图，带有绿色边框(border)的区块(div#left)在“body”里往左浮动，后面接着紫色区块(div#static)。如果 div#static 没有设定宽度，从大部分的浏览器都能显示正常，即绿色边框区块叠在紫色区块上。 </P>
<P>但是因为 div#static 已经<SPAN><STRONG>指定宽度</STRONG></SPAN>，各家浏览器的差异就很明显了。<SPAN><STRONG>Internet Explorer</STRONG></SPAN> 会将浮动元素视为 body 左侧边界的一部份，而让 div#static 放在 div#left 右侧。<SPAN><STRONG>Moz/N7</STRONG></SPAN> 和 <SPAN><STRONG>Op6/7.1</STRONG></SPAN> 则按照规格，让两个区块都固定在 body 的左侧边界上。 </P>
<H2>这有什么关系</H2>
<P>在制作复杂的浮动式版面时，通常需要指定一些区块的宽度。但如果浮动区块后面接着固定区块时，IE 的表现方式就跟其它敢于遵从标准的浏览器不一样。差别如此之大，让人不得不正视这个问题。（除非你是哈利波特里法力无边的 *那个人(you know who)*） </P>
<P>解决这个问题有好几种方法。其中之一是只帮 IE 写程序，即使知道在少数浏览器下会烂掉。或是避免使用宽度指定，让许多形式的版面都变成“禁区”。 </P>
<H2>IE 不再孤独了</H2>
<P>不过这种烦人的局面好象有越演越烈的趋势。<SPAN><STRONG>Opera7</STRONG></SPAN>（发行于 2003 年 1 月）做了跟 IE 一样的蠢事。 Opera7 本来该像 Opera6 一样，让 div#static 以视区(viewport)最左边当作基准，忽略浮动元素的存在。结果 Opera7 却把 div#static 并列于浮动元素旁边。 </P>
<P>就我个人看来，这代表 Opera 的决策者决定认输，与其固守标准规格，不如选择“好走的路”。微软确实很有影响力，显然地浮动元素的标准快行不通了。我想所谓的标准规格，大概只要比尔盖兹点头说是的就是了。 </P>
<P>可喜的是 Opera 7.1 （发行于2003年4月）正确地遵从了浮动的标准。 </P>
<H2>最后的感想</H2>
<P>我没有洁癖，能够跟微软设计的规格愉快相处。但是当微软公开支持某些规格，然后又暗地里嘲弄它们，这就让我无法忍受。这样子会有什么未来？ </P>
<P>这些问题在过去已经被一讲再讲。亲爱的读者，如果你有任何可以跟微软高层联络的管道，拜托你看看能不能探到一些未来动向的小道消息。我已经开始担心在那个新玩艺儿中，简洁明了的 CSS 无法以其“应有”的方式使用。 因为最大的浏览器厂家拒绝以正确的方式读取它。这种僵局总是要解决的；那为我们为什么不现在就一步到位呢? </P><BR>
<P class="small alignright"><A title=" Holly 'n John's Tableless Design and Repair " href="http://www.positioniseverything.net/design/"><STRONG><FONT color=#000000>Holly 'n John</FONT></STRONG></A> &nbsp; <A title="If you've found something new and&#10;interesting to say about any CSS subject, please contact me. I want to know! " href="mailto:johnthebig66@yahoo.com"><FONT color=#000000>e-mail</FONT></A> © positioniseverything<BR>最后修改日期: April 23, 2003<BR>写于 January 28, 2003 <BR></P>
<P class="small alignright"><A title="" href="http://ccca.nctu.edu.tw/~hlb/trans/pie/floatmodel.html"><FONT color=#000000>繁体中文翻译：</FONT></A><STRONG>acer</STRONG><BR>简体中文翻译: <A href="http://www.onestab.net/"><STRONG><FONT color=#000000>onestab</FONT></STRONG></A> </P></DIV><img src ="http://www.cnitblog.com/yhf119/aggbug/5335.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yhf119/" target="_blank">杨</a> 2005-12-13 15:43 <a href="http://www.cnitblog.com/yhf119/articles/5335.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用DIV之后,什么时候使用TABLE</title><link>http://www.cnitblog.com/yhf119/articles/4073.html</link><dc:creator>杨</dc:creator><author>杨</author><pubDate>Tue, 08 Nov 2005 02:45:00 GMT</pubDate><guid>http://www.cnitblog.com/yhf119/articles/4073.html</guid><wfw:comment>http://www.cnitblog.com/yhf119/comments/4073.html</wfw:comment><comments>http://www.cnitblog.com/yhf119/articles/4073.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yhf119/comments/commentRss/4073.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yhf119/services/trackbacks/4073.html</trackback:ping><description><![CDATA[<UL>
<LI>作者：allan 
<LI>转载自：<A href="http://allan.flashempire.net/blog/archive/2004/11/09/224.aspx" target=new><FONT color=#60a179>Allan.Blog</FONT></A>(本文经作者同意转载,版权归作者所有.如果您需要引用或转载请与作者联系。) 
<LI>原文发表时间：2004年11月9日 </LI></UL>
<P>今天有一好友MSN上突然问我这个话题,突然想到其实在论坛里面,关于DIV和TABLE表格的使用疑问有不少人发过贴子问过,这里我想整理一下我的思路!</P>
<H4>关于表格</H4>
<P>使用WEB标准之后,并不是说排除表格的使用,表格并不是鸡肋,而正好相反是一道大餐, 之所以在很多关于CSS布局的文章中常提到"为什么使用表格排版是不明智的"这句话,可能是大家对他的理解有误,这里注意一点"<SPAN class=code><STRONG><FONT face=Verdana color=#60a179>使用表格排版</FONT></STRONG></SPAN>"是"<SPAN class=code><STRONG><FONT face=Verdana color=#60a179>不明智</FONT></STRONG></SPAN>"的.指的是我们使用了很多年的,用表格来排版是不明智的,表格归根截底是一种显示"数据"的方式,大家可以想象一下EXCEL,表格就是起这个使用的,有的时候信息使用表格显示让我们能清晰易读,所以才使用表格,比如公司员工联系表,产品与型号对应表等.</P>
<P>那么所谓表格大餐呢,其实意见上升到了一个层次,也就是说你如果能像专业市场分析公司那样,灵活使用表格来显示客户数据和调查数据等消息的时候,那才是真正利用了表格的优势.</P>
<P>所以,关于那句使用以久的话,应该改为"<SPAN class=code><STRONG><FONT face=Verdana color=#60a179>使用表格作为网页排版, 布局页面元素是不合理的,表格是用来显示数据的</FONT></STRONG></SPAN>"。</P>
<H4>关于其它元素</H4>
<P>我这里按我的使用经验,把XHTML标准中的一些元素,分为三大类:</P>
<UL>
<LI>第一类是我称之为辅助布局设计元素:<BR>这里我指的是DIV,SPAN等,这类元素的主要功能是用来布局整个页面的,灵活使用这些元素的各种属性,可以让你的页面表现丰富多彩. 
<LI>第二类我称为结构化元素或叫信息元素<BR>这里指的是TABLE,UL,PRE,CODE类元素是一种信息显示与整理方式,比如TABLE很明显就是用来显示表格信息的,UL是用来显示列化信息的,当需要用表格或列表的时候,用这二种方式来显示是明智的。 
<LI>第三类指的是 这样的,完全是为了实现一些功能,如填上关键字的META keyword,还有做链接的A。</LI></UL>
<P>那么正确的符合标准的设计思路是: 
<UL>
<LI>使用DIV等布局元素来制作页面的设计布局,定位,色块,图片等 
<LI>使用TABLE,UL等这样的元素来显示页面中需要展示数据</LI></UL>
<P></P>
<P>当然,DIV也起整理数据的作用,使用DIV的ID属性可以很方便的将一个DIV作为一个你名命的数据块。</P>
<P>所以使用WEB标准来制作网站,实际是一个信息合理化整合的一个过程,什么地方该用什么元素还是照用不误,别把表格当布局工具就行。</P><img src ="http://www.cnitblog.com/yhf119/aggbug/4073.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yhf119/" target="_blank">杨</a> 2005-11-08 10:45 <a href="http://www.cnitblog.com/yhf119/articles/4073.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转]常用CSS缩写语法总结</title><link>http://www.cnitblog.com/yhf119/articles/4072.html</link><dc:creator>杨</dc:creator><author>杨</author><pubDate>Tue, 08 Nov 2005 02:31:00 GMT</pubDate><guid>http://www.cnitblog.com/yhf119/articles/4072.html</guid><wfw:comment>http://www.cnitblog.com/yhf119/comments/4072.html</wfw:comment><comments>http://www.cnitblog.com/yhf119/articles/4072.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yhf119/comments/commentRss/4072.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yhf119/services/trackbacks/4072.html</trackback:ping><description><![CDATA[<P>出处：<A href="http://www.w3cn.org/article/tips/2005/103.html">http://www.w3cn.org/article/tips/2005/103.html</A><BR><BR>使用缩写可以帮助减少你CSS文件的大小，更加容易阅读。css缩写的主要规则如下：</P>
<H4>颜色</H4>
<P>16进制的色彩值，如果每两位的值相同，可以缩写一半，例如：<BR>#000000可以缩写为#000;#336699可以缩写为#369;</P>
<H4>盒尺寸</H4>
<P>通常有下面四种书写方法:</P>
<UL>
<LI>property:value1; 表示所有边都是一个值value1； 
<LI>property:value1 value2; 表示top和bottom的值是value1,right和left的值是value2 
<LI>property:value1 value2 value3; 表示top的值是value1，right和left的值是value2，bottom的值是value3 
<LI>property:value1 value2 value3 value4; 四个值依次表示top,right,bottom,left </LI></UL>
<P>方便的记忆方法是顺时针，上右下左。具体应用在margin和padding的例子如下：<BR>margin:1em 0 2em 0.5em; </P>
<H4>边框(border)</H4>
<P>边框的属性如下：</P>
<UL>
<LI>border-width:1px; 
<LI>border-style:solid; 
<LI>border-color:#000; </LI></UL>
<P>可以缩写为一句：border:1px solid #000; </P>
<P>语法是<SPAN class=code><STRONG><FONT face=Verdana color=#60a179>border:width style color;</FONT></STRONG></SPAN> </P>
<H4>背景(Backgrounds)</H4>
<P>背景的属性如下：</P>
<UL>
<LI>background-color:#f00; 
<LI>background-image:url(background.gif); 
<LI>background-repeat:no-repeat; 
<LI>background-attachment:fixed; 
<LI>background-position:0 0; </LI></UL>
<P>可以缩写为一句：background:#f00 url(background.gif) no-repeat fixed 0 0; </P>
<P>语法是<SPAN class=code><STRONG><FONT face=Verdana color=#60a179>background:color image repeat attachment position;</FONT></STRONG></SPAN></P>
<P>你可以省略其中一个或多个属性值，如果省略，该属性值将用浏览器默认值，默认值为：</P>
<UL>
<LI>color: transparent 
<LI>image: none 
<LI>repeat: repeat 
<LI>attachment: scroll 
<LI>position: 0% 0% </LI></UL>
<H4>字体(fonts)</H4>
<P>字体的属性如下：</P>
<UL>
<LI>font-style:italic; 
<LI>font-variant:small-caps; 
<LI>font-weight:bold; 
<LI>font-size:1em; 
<LI>line-height:140%; 
<LI>font-family:"Lucida Grande",sans-serif; </LI></UL>
<P>可以缩写为一句：font:italic small-caps bold 1em/140% "Lucida Grande",sans-serif;</P>
<P>注意，如果你缩写字体定义，至少要定义font-size和font-family两个值。</P>
<H4>列表(lists)</H4>
<P>取消默认的圆点和序号可以这样写list-style:none;,</P>
<P>list的属性如下:</P>
<UL>
<LI>list-style-type:square; 
<LI>list-style-position:inside; 
<LI>list-style-image:url(image.gif); </LI></UL>
<P>可以缩写为一句：list-style:square inside url(image.gif);</P><img src ="http://www.cnitblog.com/yhf119/aggbug/4072.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yhf119/" target="_blank">杨</a> 2005-11-08 10:31 <a href="http://www.cnitblog.com/yhf119/articles/4072.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转]应用WEB标准进行网站设计－－《网站重构》读书笔记</title><link>http://www.cnitblog.com/yhf119/articles/4071.html</link><dc:creator>杨</dc:creator><author>杨</author><pubDate>Tue, 08 Nov 2005 02:05:00 GMT</pubDate><guid>http://www.cnitblog.com/yhf119/articles/4071.html</guid><wfw:comment>http://www.cnitblog.com/yhf119/comments/4071.html</wfw:comment><comments>http://www.cnitblog.com/yhf119/articles/4071.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yhf119/comments/commentRss/4071.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yhf119/services/trackbacks/4071.html</trackback:ping><description><![CDATA[<P>出处：<A href="http://thinhunan.cnblogs.com/archive/2005/08/19/218572.html">http://thinhunan.cnblogs.com/archive/2005/08/19/218572.html</A><BR><BR>议题一：为什么要根据web standards来制作网页？<BR>书中用了几十页的内容说明“99.9%的网页都是过时的”，总结起来，要应用web standards的原因如下：<BR>1、一次编写，到处正常显示。（摒弃原来的为不同浏览器写不同版本的CSS/HTML/Script的做法）<BR>2、向后兼容。（使你的网站在很少更新下，活得更久）<BR>3、节约成本。（重构表现与数据代码混杂在一起的页面设计，减少页面的大小，节约带宽）</P>
<P><BR>议题二：怎么做是应用了web standards？<BR>1、对心爱的HTML语言说Bye bye!你的新欢是XHTML。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A、为什么要使用XHMTL？<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a)XHTML是当前用来代替HTML4置标语言的标准；<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b)XHTML是XML的一个分支，天生可以与其它XML数据进行良好的交互；<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c)XHTML比HTML有更好的一致性，因为它是汲取HTML不一致教训后的产物；<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d)XHTML是发展趋势。（好弱的一句话）<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e)老的浏览器能像HTML一样适应XHTML；<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f)XHTML能很好的在无线设备、屏幕阅读器上工作，就像运行在桌面浏览器上一样。所以，良</P>
<P>好的设计后，你的网站可以不需要WAP版本就能满足手机访客的需求。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g)它是web standards的一员<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; h)可以帮助你表现和数据写在一起的习惯<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; B、从HTML到XHTML要怎么做？<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a)用DOCTYPE和Namespace。XHTML要这个东西做它的DTD，因为以上我们说了，XHTML是XML的后代。不同的DOCTYPE，定义不同的标准，直接影响浏览器对页面代码的解析。现在我们有三种DTD：<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Strict---不能使用任何表现层的标记和属性，包括width;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Frameset---适应框架页面;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Transitional---过滤型的标准，很大程度上容忍你一直以来的坏毛病。其实这个东西是我们最熟悉的，打开一个你用VS.net生成的asp.net页面生成的代码，你会看到这样的一个头</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">&lt;!</SPAN><SPAN style="COLOR: #ff00ff">DOCTYPE&nbsp;HTML&nbsp;PUBLIC&nbsp;"-//W3C//DTD&nbsp;HTML&nbsp;4.01&nbsp;Transitional//EN"&nbsp;<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>"http://www.w3.org/TR/html4/loose.dtd"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">HTML</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">HEAD</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;..<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>
<P>这个头就是我现在编辑本文所用的博客园的页面生成的（偷懒一下）。我们可以看到Transitional这个关键字，所以，VS.net IDE在默认情况下让我们使用过滤型的标准。不过可惜的是，VS.net 2002生成的代码是不完整的，就是说，并没有真正使浏览器应用XHTML标准</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">&lt;!</SPAN><SPAN style="COLOR: #ff00ff">DOCTYPE&nbsp;HTML&nbsp;PUBLIC&nbsp;"-//W3C//DTD&nbsp;HTML&nbsp;4.0&nbsp;Transitional//EN"&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">head</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>
<P>不过，真正保险的是到<A href="http://www.webstandards.org/learn/templates/xhtml10t.html">http://www.webstandards.org/learn/templates/xhtml10t.html</A>这个页面去拷，因为不管怎样，它都没有帮你把Namespcace加上去。</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">&lt;!</SPAN><SPAN style="COLOR: #ff00ff">DOCTYPE&nbsp;html&nbsp;PUBLIC&nbsp;"-//W3C//DTD&nbsp;XHTML&nbsp;1.0&nbsp;<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>Transitional//EN"<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html&nbsp;</SPAN><SPAN style="COLOR: #ff0000">xmlns</SPAN><SPAN style="COLOR: #0000ff">="http://www.w3.org/1999/xhtml"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">head</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">title</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000">Conforming&nbsp;XHTML&nbsp;1.0&nbsp;Transitional&nbsp;Template</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">title</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">head</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">body</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">body</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">html</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b)用小写字母书写所有的标签；<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c)给所有的属性值加上引号，属性中的单引号和又引号用&amp;apos;和&amp;quot;来代替，属性之间必须</P>
<P>要有空格分开；<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d)所有的属性都要有值，例如：&lt;td nowrap = "nowrap"&gt; &lt;input ...... checked= "checked" /&gt;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e)所有的标签都需要关闭，例如：&lt;p&gt;一定要有&lt;/p&gt;,甚至&lt;br /&gt;,&lt;img /&gt;&lt;input /&gt;(注意/前要有一个空格)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f)不要在注释的内容中使用"--",它只能用于注释的开始和结尾；<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g)&lt; = &amp;lt; &amp; = &amp;amp; &gt; = &amp;gl;<BR>2、意识到&lt;center&gt;&lt;font&gt;&lt;embed&gt;等标记是非法的，而&lt;br /&gt;是不意义的。正确的使用CSS控制字体、颜色、空白等。<BR>3、尽量少使用表格来控制布局，通过CSS来避免表格的多层嵌套。并应用结构化标签来代替表格。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 很沮丧的是，我以前也一直用表格来做控制布局的事，甚至我在写一个页面之初都习惯先table一下，但是问题是表格并不能表达所以有数据结构，比如一下Menu，其实用&lt;ul&gt;&lt;li&gt;Menu1&lt;/li&gt;&lt;li&gt;Menu2&lt;/li&gt;&lt;/ul&gt;更能体现其数据的组织结构，而且，合理使用CSS样式，我们一样可以做出各种炫目的效果。再比如，以前我用表格来控制文本之间的间隔，用透明的小GIF图片来达到边续空白的效果，是的，这些代码确实方便的达到了我想要的效果，不过，这些代码本身不能代表什么意义，它只是使你的页面代码混乱无章，臃肿宠大。现在，我们可以考虑定义好合理的P,H1,H2等等段落的样式，就能达到一样的显示效果，同时，你的页面中的数据的结构清晰明了，文件也瘦身不少----对了，这叫做结构化无素代替数据与表示混杂。如果这些结构化元素不能满足你的要求，那你就用DIV吧，用float属性来控件DIV之间相互的排列关系，这样做最显著的效果就是你要改变两个“块”的位置时，非常方便，不用迷失在一个个嵌套的表格中，爽啊！还有，给你的每个元素命上有意义又很简短的ID，“有意义”的意义，地球人都知道，简短还是为了节省带宽，给你的老板省钱，然后，你就可以在CSS中用#yourelementid{... ...}来精确的定义一个元素的样式了。最后，提醒大家，不要过多使用DIV和CSSCLASS。（终于可以不用Fireworks做图片切片了，笑！）<BR>4、使用基于DOM的ECMAScript精确的控件页面对象，可惜的是，如果你要适应Navigator4.0这个还有些人在用的老东西，可能还是要写代码分支，因为它不支持DOM。<BR>5、可访问性。（在有法律规定网站必须要照顾盲人访问之前，我可能还是不会为这一点做一些工作）</P>
<P><BR>议题三：CSS的一些细节。<BR>1、能用CSS的地方，就不用JS（因为，这样做符合抽离表现代码的原则）,如：</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">img&nbsp;</SPAN><SPAN style="COLOR: #ff0000">src</SPAN><SPAN style="COLOR: #0000ff">='a.gif'&nbsp;</SPAN><SPAN style="COLOR: #ff0000">onmouseover</SPAN><SPAN style="COLOR: #0000ff">="this.src='b.gif'"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;onmouseout</SPAN><SPAN style="COLOR: #0000ff">="this.src='a.gif'"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;onclick</SPAN><SPAN style="COLOR: #0000ff">="window.location='xx.htm'"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN></DIV></DIV>
<P>改成</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG id=Codehighlighter1_43_208_Open_Image onclick="this.style.display='none'; Codehighlighter1_43_208_Open_Text.style.display='none'; Codehighlighter1_43_208_Closed_Image.style.display='inline'; Codehighlighter1_43_208_Closed_Text.style.display='inline';" src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_43_208_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_43_208_Closed_Text.style.display='none'; Codehighlighter1_43_208_Open_Image.style.display='inline'; Codehighlighter1_43_208_Open_Text.style.display='inline';" src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">a&nbsp;</SPAN><SPAN style="COLOR: #ff0000">href</SPAN><SPAN style="COLOR: #0000ff">='xx.htm'&nbsp;</SPAN><SPAN style="COLOR: #ff0000">id</SPAN><SPAN style="COLOR: #0000ff">="mya"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #ff0000">&amp;nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">a</SPAN><SPAN style="COLOR: #0000ff">&gt;&lt;</SPAN><SPAN style="COLOR: #800000">style</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN id=Codehighlighter1_43_208_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://thinhunan.cnblogs.com/Images/dot.gif"></SPAN><SPAN id=Codehighlighter1_43_208_Open_Text><SPAN style="COLOR: #800000; BACKGROUND-COLOR: #f5f5f5">a&nbsp;#mya&nbsp;</SPAN><SPAN id=Codehighlighter1_50_131_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">{<IMG src="http://thinhunan.cnblogs.com/Images/dot.gif">}</SPAN><SPAN id=Codehighlighter1_50_131_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{</SPAN><SPAN style="COLOR: #ff0000; BACKGROUND-COLOR: #f5f5f5">width</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">:</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">100px</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;</SPAN><SPAN style="COLOR: #ff0000; BACKGROUND-COLOR: #f5f5f5">height</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">:</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">25px</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;</SPAN><SPAN style="COLOR: #ff0000; BACKGROUND-COLOR: #f5f5f5">background</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">:</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">&nbsp;url("a.gif")</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;</SPAN><SPAN style="COLOR: #ff0000; BACKGROUND-COLOR: #f5f5f5">&nbsp;background-repeat</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">:</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">&nbsp;no-repeat</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;</SPAN><SPAN style="COLOR: #ff0000; BACKGROUND-COLOR: #f5f5f5">;</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">}</SPAN></SPAN><SPAN style="COLOR: #800000; BACKGROUND-COLOR: #f5f5f5">a#mya:hover</SPAN><SPAN id=Codehighlighter1_143_199_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">{<IMG src="http://thinhunan.cnblogs.com/Images/dot.gif">}</SPAN><SPAN id=Codehighlighter1_143_199_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{</SPAN><SPAN style="COLOR: #ff0000; BACKGROUND-COLOR: #f5f5f5">background</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">:</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">&nbsp;url("b.gif")</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;</SPAN><SPAN style="COLOR: #ff0000; BACKGROUND-COLOR: #f5f5f5">&nbsp;background-repeat</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">:</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">&nbsp;no-repeat</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">}</SPAN></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">style</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN></DIV></DIV>
<P></SPAN><BR>2、不同版本的浏览器对CSS的支持程度是不一样的，我们可以用外联和导入做一个分级。<BR>&nbsp;因为外联的方式，只要浏览器支持CSS，就会支持，所以，把一般的CSS效果放在外联样式表中，供所有的浏览器使用，把一些要高版本的浏览器才支持的CSS效果写在导入样式表中。代码如下：</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">link&nbsp;</SPAN><SPAN style="COLOR: #ff0000">rel</SPAN><SPAN style="COLOR: #0000ff">="stylesheet"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;href</SPAN><SPAN style="COLOR: #0000ff">="/allstyles.css"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;type</SPAN><SPAN style="COLOR: #0000ff">="text/css"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;media</SPAN><SPAN style="COLOR: #0000ff">="all"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_111_135_Open_Image onclick="this.style.display='none'; Codehighlighter1_111_135_Open_Text.style.display='none'; Codehighlighter1_111_135_Closed_Image.style.display='inline'; Codehighlighter1_111_135_Closed_Text.style.display='inline';" src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_111_135_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_111_135_Closed_Text.style.display='none'; Codehighlighter1_111_135_Open_Image.style.display='inline'; Codehighlighter1_111_135_Open_Text.style.display='inline';" src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">style&nbsp;</SPAN><SPAN style="COLOR: #ff0000">type</SPAN><SPAN style="COLOR: #0000ff">="text/css"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;media</SPAN><SPAN style="COLOR: #0000ff">="all"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN id=Codehighlighter1_111_135_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://thinhunan.cnblogs.com/Images/dot.gif"></SPAN><SPAN id=Codehighlighter1_111_135_Open_Text><SPAN style="COLOR: #800000; BACKGROUND-COLOR: #f5f5f5">@import&nbsp;"/advstyles.css";</SPAN></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">style</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>
<P>3、盒模型（像TABLE这样的像一个盒子一样的页面块）BUG<BR>IE5.X/WINDOW和我们大部分的人都有这样的一个BUG，我们在考虑如何往一个大盒子里装很多的小盒子时，我们只关心每个盒子的大小，不关心盒子里的东西的大小，这本没有错，不过在CSS标准中，这是一个BUG，因为，在CSS中width指的是盒子的内容的宽度！！！就是说，你指定一个DIV的WIDTH是100PX，这个DIV的BORDER宽是1PX，MARGIN和PADDING都为0的话，这个DIV在IE5/WIN下的最终占的地方的宽度是100px而在其它如IE6/WIN,IE5/Macintosh,NS6、7,Mozilla,Safari,Opera5、6、7上它最终占地宽度是102px,这下你晕了吧，解决办法就是，这样写你的CSS表：</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">div.boxclass1{<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;border:20px&nbsp;solid;<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;padding:30px;<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;background:#ffc;<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;width:400px;&nbsp;/*&nbsp;False&nbsp;value&nbsp;for&nbsp;IE4-5.*/Win&nbsp;*/<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;voice-family:"\"}"\"";<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;voice-family:inherit;<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;width:300px;/*&nbsp;Actual&nbsp;value&nbsp;for&nbsp;conformant&nbsp;browsers&nbsp;*/<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>}<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>html&gt;body.boxclass1{<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;width:300px;&nbsp;/*&nbsp;Be&nbsp;nice&nbsp;to&nbsp;Opera&nbsp;*/<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>}<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>
<P>原理是：IE4-5.*/win和Opera7读到声音属性时不能理解，所以停止读下去，使width值被设成400px，但Opera对盒模型的理解和CSS标准双是相符的，所以，后面的那一段专门针对它设值为300px。<BR>4、IE/WIN的空格BUG<BR>在IE/WIN环境下，<BR>&lt;td&gt;&lt;img src="a.gif" /&gt;&lt;/td&gt;<BR>和<BR>&lt;td&gt;<BR>&nbsp;&lt;img src="a.gif" /&gt;<BR>&lt;/td&gt;<BR>产生的效果是不一样的，第二段XHTML代码会生成多余的空白。解决的办法很简单，把多余的空格去掉！<BR>5、IE6/WIN上的float BUG<BR>应用float属性排版的块在IE6/WIN下会出现计算高度错误，如果块中的内容过高，IE6会删减减其中的内容，滚动条也会消失，要按两次F11才能恢复滚动条。可以用以下这段JS修复：</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(document.all&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;window.attachEvent)<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;window.attachEvent(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">onload</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,fixWinIE);<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">function</SPAN><SPAN style="COLOR: #000000">&nbsp;fixWinIE()<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>{<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(document.body.scrollHeight&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">&nbsp;document.all.YOURFLOATBOX.offsetHeight)<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;{<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;document.all.YOURFLOATBOX.style.display</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">'block';<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;}<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>}</SPAN></DIV></DIV>
<P>不过最好是不用float,试试</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #800000">position:absolute;left:0</SPAN></DIV></DIV>
<P>组合<BR>6、CSS2中的相对设值<BR></P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG id=Codehighlighter1_3_23_Open_Image onclick="this.style.display='none'; Codehighlighter1_3_23_Open_Text.style.display='none'; Codehighlighter1_3_23_Closed_Image.style.display='inline'; Codehighlighter1_3_23_Closed_Text.style.display='inline';" src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_3_23_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_3_23_Closed_Text.style.display='none'; Codehighlighter1_3_23_Open_Image.style.display='inline'; Codehighlighter1_3_23_Open_Text.style.display='inline';" src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN style="COLOR: #800000">p+p</SPAN><SPAN id=Codehighlighter1_3_23_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">{<IMG src="http://thinhunan.cnblogs.com/Images/dot.gif">}</SPAN><SPAN id=Codehighlighter1_3_23_Open_Text><SPAN style="COLOR: #000000">{</SPAN><SPAN style="COLOR: #ff0000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;text-indent</SPAN><SPAN style="COLOR: #000000">:</SPAN><SPAN style="COLOR: #0000ff">2em</SPAN><SPAN style="COLOR: #000000">;</SPAN><SPAN style="COLOR: #ff0000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">}</SPAN></SPAN><SPAN style="COLOR: #800000"><BR><IMG id=Codehighlighter1_31_51_Open_Image onclick="this.style.display='none'; Codehighlighter1_31_51_Open_Text.style.display='none'; Codehighlighter1_31_51_Closed_Image.style.display='inline'; Codehighlighter1_31_51_Closed_Text.style.display='inline';" src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_31_51_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_31_51_Closed_Text.style.display='none'; Codehighlighter1_31_51_Open_Image.style.display='inline'; Codehighlighter1_31_51_Open_Text.style.display='inline';" src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align=top>img+h3</SPAN><SPAN id=Codehighlighter1_31_51_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">{<IMG src="http://thinhunan.cnblogs.com/Images/dot.gif">}</SPAN><SPAN id=Codehighlighter1_31_51_Open_Text><SPAN style="COLOR: #000000">{</SPAN><SPAN style="COLOR: #ff0000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;margin-top</SPAN><SPAN style="COLOR: #000000">:</SPAN><SPAN style="COLOR: #0000ff">15px</SPAN><SPAN style="COLOR: #000000">;</SPAN><SPAN style="COLOR: #ff0000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">}</SPAN></SPAN><SPAN style="COLOR: #800000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>
<P>什么意思呢，P后面再加的P的第一行缩进2个字，图后的H3上留15px的空白。<BR>7、滑动门技术<BR><A href="http://www.alistapart.com/articles/slidingdoors/">http://www.alistapart.com/articles/slidingdoors/</A></P>
<P>议题四：其它<BR>嵌入多媒体对象<BR>&nbsp;W3C提倡用&lt;object&gt;不过我们却习惯用着&lt;img&gt;&lt;embed&gt;。&lt;embed&gt;到现在都不是有效的HTML和XHTML标准标签。XHTML标准的flash语法是</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">object&nbsp;</SPAN><SPAN style="COLOR: #ff0000">type</SPAN><SPAN style="COLOR: #0000ff">="application/x-shockwave-flash"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;data</SPAN><SPAN style="COLOR: #0000ff">="movie.swf"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;width</SPAN><SPAN style="COLOR: #0000ff">="400"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;height</SPAN><SPAN style="COLOR: #0000ff">="300"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">param&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="movie"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="movie.swf"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">object</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>
<P>可惜这个符合标准的写法在IE/WIN下有不能连续播放的问题，于是，又有了以下标准和正常使用折中的办法：</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">script&nbsp;type</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">text/javascript</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&lt;![CDATA[</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(navigator.mineTypes&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;navigator.mimeTypes[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">application/x-shockwave-flash</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">])<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>{<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;document.write('</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">embed&nbsp;src</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">movie.swf</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;<IMG src="http://thinhunan.cnblogs.com/Images/dot.gif">&nbsp;<IMG src="http://thinhunan.cnblogs.com/Images/dot.gif">&nbsp;<BR><IMG src="http://thinhunan.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV><img src ="http://www.cnitblog.com/yhf119/aggbug/4071.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yhf119/" target="_blank">杨</a> 2005-11-08 10:05 <a href="http://www.cnitblog.com/yhf119/articles/4071.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>