<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>十四像素</title>
	<atom:link href="http://www.14px.com/index.php?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.14px.com</link>
	<description>我们在无常中感慨生之渺小命之飘乎IE之变幻莫测</description>
	<pubDate>Tue, 03 Aug 2010 17:12:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>利用box-sizing实现div仿框架</title>
		<link>http://www.14px.com/?p=196</link>
		<comments>http://www.14px.com/?p=196#comments</comments>
		<pubDate>Sat, 21 Nov 2009 08:43:49 +0000</pubDate>
		<dc:creator>Chomo</dc:creator>
		
		<category><![CDATA[xhtml+css]]></category>

		<category><![CDATA[css3]]></category>

		<category><![CDATA[frame]]></category>

		<guid isPermaLink="false">http://www.14px.com/?p=196</guid>
		<description><![CDATA[[参与测试的浏览器：IE6 / IE7 / IE8 / FF3 / OP10 / SF4 / Chrome2 ]
[操作系统：Windows]
先看代码：

&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62;
&#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&#62;
&#60;head&#62;
&#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=utf-8&#34; /&#62;
&#60;meta name=&#34;author&#34; content=&#34;Chomo&#34; /&#62;
&#60;link rel=&#34;start&#34; href=&#34;http://www.14px.com&#34; title=&#34;Home&#34; /&#62;
&#60;title&#62;利用box-sizing实现div仿框架&#60;/title&#62;
&#60;style type=&#34;text/css&#34;&#62;
* { margin:0; padding:0;}
html { -webkit-box-sizing:border-box; -moz-box-sizing:border-box; box-sizing:border-box; padding:100px 0; overflow:hidden;}
html,body { height:100%;}
.top { position:relative; margin-top:-100px; height:100px; background:#f60;}
.side { position:relative; height:100%; background:#fc0; [...]]]></description>
			<content:encoded><![CDATA[<p>[参与测试的浏览器：IE6 / IE7 / IE8 / FF3 / OP10 / SF4 / Chrome2 ]<br />
[操作系统：Windows]</p>
<p>先看代码：</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_S9rgvw">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;利用box-sizing实现div仿框架&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* { margin:0; padding:0;}
html { -webkit-box-sizing:border-box; -moz-box-sizing:border-box; box-sizing:border-box; padding:100px 0; overflow:hidden;}
html,body { height:100%;}
.top { position:relative; margin-top:-100px; height:100px; background:#f60;}
.side { position:relative; height:100%; background:#fc0; overflow:auto; width:200px; float:left; margin-right:0 !important; margin-right:-3px; overflow:auto;}
.main { position:relative; overflow:auto; height:100%; background:#f30;}
.bottom { position:relative; height:100px; background:#f60; clear:both;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;top&quot;&gt;
	top
&lt;/div&gt;
&lt;div class=&quot;side&quot;&gt;
	side
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div class=&quot;main&quot;&gt;
	main
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div class=&quot;bottom&quot;&gt;
	bottom
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_S9rgvw');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_S9rgvw');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>原理大概就是这样的：</p>
<p><a href="http://www.14px.com/wp-content/uploads/2009/11/s.gif"><img src="http://www.14px.com/wp-content/uploads/2009/11/s.gif" alt="改变&lt;html&gt;的box-sizing" class="size-medium wp-image-194" /></a></p>
<p>千言万语抵不过一副画，通过整容前后的对比，大家应该能看出box-sizing:border-box的作用了。</p>
<p>了解box-sizing的同学们应该知道，它来自离微国比较遥远的css3世界，因此IE6/IE7是不支持的，但我很负责任滴说：本demo正常兼容IE6/IE7。</p>
<p>因为……</p>
<p>IE6/IE7下，&lt;html&gt;的box-sizing默认值本就是border-box（注：IE7有一点点不正常，overflow:hidden后神志有所恢复，将不影响本demo正常运作）。</p>
<p>现在的问题就是是不是要采用这个方法了，给点优劣的对比，大家自行斟酌吧：</p>
<p>比较使用绝对定位的方法来实现，这个方法在目前主要存在两个优势：</p>
<ol>
<li>针对每种浏览器基本使用的同一方法，css代码简单，易修改、易理解。</li>
<li>兼容。绝对定位的方法在OP10下存在暂时找不着修复bug的办法，只好绕个弯走了。</li>
</ol>
<p>它最大的劣势就是欠灵活，如果没有IE6，我想我是坚决选择绝对定位的方法的。</p>
<p>以下为应用实例demo。</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_qG0rgV">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;利用box-sizing实现div仿框架&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* { margin:0; padding:0;}
html { -webkit-box-sizing:border-box; -moz-box-sizing:border-box; box-sizing:border-box; padding:100px 0; position:relative; overflow:hidden;}
html,body { height:100%;}
.top { position:relative; margin-top:-100px; height:100px; background:#f60;}
.side { position:relative; height:100%; background:#fc0; overflow:auto; width:200px; float:left; margin-right:0 !important; margin-right:-3px; overflow:auto;}
.main { position:relative; overflow:hidden; height:100%; background:#f30; padding-top:100px; margin-top:-100px; top:50px; margin-left:200px; _margin-left:0; z-index:2;}
.main iframe { height:100%; width:100%; background:#fff; position:absolute; left:0; top:0;}
.bottom { position:relative; height:100px; background:#f60; clear:both;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;top&quot;&gt;
	top
&lt;/div&gt;
&lt;div class=&quot;side&quot;&gt;
	side
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div class=&quot;main&quot;&gt;
	&lt;iframe frameborder=&quot;0&quot; src=&quot;http://www.g.cn/&quot;&gt;&lt;/iframe&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div class=&quot;bottom&quot;&gt;
	bottom
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_qG0rgV');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_qG0rgV');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p><strong>一个应注意的问题：</strong></p>
<p>不要给body以overflow:hidden，它将会无情地隐藏掉任何在它以外的任何东西，包括top/bottom（header/footer）；</p>
<p><strong>一个应理解的要点：</strong></p>
<p>[100%+(N)px] 的高度产生的方法：div { height:100%; padding-top:(N)px;}。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.14px.com/?feed=rss2&amp;p=196</wfw:commentRss>
		</item>
		<item>
		<title>inline-block对象间的缝隙</title>
		<link>http://www.14px.com/?p=187</link>
		<comments>http://www.14px.com/?p=187#comments</comments>
		<pubDate>Sat, 07 Nov 2009 10:02:44 +0000</pubDate>
		<dc:creator>Chomo</dc:creator>
		
		<category><![CDATA[xhtml+css]]></category>

		<category><![CDATA[inline-block]]></category>

		<guid isPermaLink="false">http://www.14px.com/?p=187</guid>
		<description><![CDATA[[参与测试的浏览器：IE6 / IE7 / IE8 / FF3.5 / OP10 / SF4 / Chrome2 ]
[操作系统：Windows]
inline-block用于块对象的横向排列（如图片组），其有着一些float不可替代的作用（如不错位、可垂直居中等），但在实际应用中，还是存在一个很纠结的弊端——有缝：

&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62;
&#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&#62;
&#60;head&#62;
&#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=utf-8&#34; /&#62;
&#60;meta name=&#34;author&#34; content=&#34;Chomo&#34; /&#62;
&#60;link rel=&#34;start&#34; href=&#34;http://www.14px.com&#34; title=&#34;Home&#34; /&#62;
&#60;title&#62;inline-block对象间的缝隙&#60;/title&#62;
&#60;style type=&#34;text/css&#34;&#62;
* { margin:0; padding:0;}
.father span { display:inline-block; background:#f60; width:100px; height:100px;}
&#60;/style&#62;
&#60;/head&#62;
&#60;body&#62;
&#60;div class=&#34;father&#34;&#62;
	&#60;span&#62;内容&#60;/span&#62;
	&#60;span&#62;内容&#60;/span&#62;
&#60;/div&#62;
&#60;/body&#62;
&#60;/html&#62;
  提示：你可以先修改部分代码再运行。

通常情况下，我们需要inline-block的元素是块对象：

&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62;
&#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&#62;
&#60;head&#62;
&#60;meta http-equiv=&#34;Content-Type&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>[参与测试的浏览器：IE6 / IE7 / IE8 / FF3.5 / OP10 / SF4 / Chrome2 ]<br />
[操作系统：Windows]</p>
<p>inline-block用于块对象的横向排列（如图片组），其有着一些float不可替代的作用（如不错位、可垂直居中等），但在实际应用中，还是存在一个很纠结的弊端——有缝：</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_s9ZTmR">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;inline-block对象间的缝隙&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* { margin:0; padding:0;}
.father span { display:inline-block; background:#f60; width:100px; height:100px;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;father&quot;&gt;
	&lt;span&gt;内容&lt;/span&gt;
	&lt;span&gt;内容&lt;/span&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_s9ZTmR');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_s9ZTmR');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>通常情况下，我们需要inline-block的元素是块对象：</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_6Y1TNK">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;当对象为块对象时&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* { margin:0; padding:0;}
.father li { display:inline-block; *display:inline; zoom:1; background:#f60; width:100px; height:100px;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;ul class=&quot;father&quot;&gt;
	&lt;li&gt;内容&lt;/li&gt;
	&lt;li&gt;内容&lt;/li&gt;
&lt;/ul&gt;
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_6Y1TNK');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_6Y1TNK');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>大家可以看到缝隙大小不一，而且当对象是块对象时，IE6/7因为是模拟的inline-block，完全没有缝隙。</p>
<p>经肉眼观察和肉手测试，发现这个该死的缝隙与字体和文字大小密切相关，故提供灭缝方法如下：</p>
<p>对象为内联对象时：</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_TRMW_z">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;对象为内联对象时的解决方法&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* { margin:0; padding:0;}
.father { font-family:simsun; font-size:12px;}
.father span { display:inline-block; background:#f60; width:100px; height:100px; margin-right:-0.5em;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;father&quot;&gt;
	&lt;span&gt;内容&lt;/span&gt;
	&lt;span&gt;内容&lt;/span&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_TRMW_z');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_TRMW_z');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>对象为块对象时：</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_O4aMAd">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;当对象为块对象时的解决方法&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* { margin:0; padding:0;}
.father { font-size:12px; font-family:simsun;}
.father li { display:inline-block; *display:inline; zoom:1; background:#f60; width:100px; height:100px; margin-right:0.5em; *margin-right:0;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;ul class=&quot;father&quot;&gt;
	&lt;li&gt;内容&lt;/li&gt;
	&lt;li&gt;内容&lt;/li&gt;
&lt;/ul&gt;
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_O4aMAd');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_O4aMAd');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>在这里回答一个疑问，既然是与字体大小相关，那为什么不直接使用font-size:0，然后在子对象上再进行大小恢复呢？<br />
答：因为即使这样设置了safari和chrome以及为块对象时的ie6和ie7还是有1px的问题，要单独hack，忒麻烦。</p>
<p>总结一下，关键几点：</p>
<p>1. 缝隙的宽度与文字大小相关，你可以把缝隙看作一个文本节点，字越大，缝越大。<br />
2. 这个文本节点是由于换行产生的，故，如果span和span之间或li与li之间不存在换行，那就没必要这么罗嗦了。（为了美丽的排版，我相信多数人会选择换行的）<br />
3. 示例中采用了font-family:simsun，这是因为宋体是等宽字体，这样各浏览器对这个文本节点的宽度就很一致了：0.5em。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.14px.com/?feed=rss2&amp;p=187</wfw:commentRss>
		</item>
		<item>
		<title>全屏屏蔽、自动居中的lightBox</title>
		<link>http://www.14px.com/?p=183</link>
		<comments>http://www.14px.com/?p=183#comments</comments>
		<pubDate>Thu, 23 Jul 2009 11:45:40 +0000</pubDate>
		<dc:creator>Chomo</dc:creator>
		
		<category><![CDATA[xhtml+css]]></category>

		<category><![CDATA[lightBox]]></category>

		<guid isPermaLink="false">http://www.14px.com/?p=183</guid>
		<description><![CDATA[[参与测试的浏览器：IE6 / IE7 / IE8 / FF3.5 / OP9.6 / SF4 / Chrome2 ]
[操作系统：Windows]
本教程旨在实现lightBox时的样式与行为分离，减少JS在各方面（全屏遮蔽、ie6中遮蔽select、双向居中、高度自适应内容等）的工作。
先上代码：

&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62;
&#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&#62;
&#60;head&#62;
&#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=utf-8&#34; /&#62;
&#60;meta name=&#34;author&#34; content=&#34;Chomo&#34; /&#62;
&#60;link rel=&#34;start&#34; href=&#34;http://www.14px.com&#34; title=&#34;Home&#34; /&#62;
&#60;title&#62;全屏屏蔽、自动居中的lightBox&#60;/title&#62;
&#60;style type=&#34;text/css&#34;&#62;
* { margin:0; padding:0; }
html,body { height:100%; overflow:hidden; font:12px/1.5 simsun;}
.myPage { line-height:3; overflow:auto; width:100%; height:100%;}
.lightBox,
.popupCover,
.popupIframe,
.popupComponent { position:absolute; left:0; top:0; width:100%; height:100%;}
.popupComponent { [...]]]></description>
			<content:encoded><![CDATA[<p>[参与测试的浏览器：IE6 / IE7 / IE8 / FF3.5 / OP9.6 / SF4 / Chrome2 ]<br />
[操作系统：Windows]</p>
<p>本教程旨在实现lightBox时的样式与行为分离，减少JS在各方面（全屏遮蔽、ie6中遮蔽select、双向居中、高度自适应内容等）的工作。</p>
<p>先上代码：</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_CxGO3F">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;全屏屏蔽、自动居中的lightBox&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* { margin:0; padding:0; }
html,body { height:100%; overflow:hidden; font:12px/1.5 simsun;}
.myPage { line-height:3; overflow:auto; width:100%; height:100%;}
.lightBox,
.popupCover,
.popupIframe,
.popupComponent { position:absolute; left:0; top:0; width:100%; height:100%;}
.popupComponent { z-index:2; display:none;}
.popupIframe { display:none; _display:block; _filter:alpha(opacity=0);}
.popupCover { background:#000; opacity:0.7; *filter:alpha(opacity=70);}
.lightBox { text-align:center; overflow:auto;}
.lightBoxContent { display:inline-block; *display:inline; zoom:1; width:300px; padding:10px; background:#fff; border:5px solid #00b4ff; vertical-align:middle;}
.lightBoxMaxHeight { display:inline-block; vertical-align:middle; height:100%; *height:99.5%; width:1px; overflow:hidden; margin-left:-1px;}
.lightBoxWrapper { display:inline-block; *display:inline; zoom:1; text-align:left;}
.lightBoxClose { color:#f00;}
.lightBoxSubmit { margin-top:10px; padding-top:5px; border-top:1px solid #ccc;}
.lightBoxSubmit input { font-size:12px; padding:0 10px; overflow:visible; margin:0 5px;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;popupComponent&quot; id=&quot;lightBox&quot;&gt;
	&lt;iframe class=&quot;popupIframe&quot;&gt;&lt;/iframe&gt;
	&lt;div class=&quot;popupCover&quot;&gt;&lt;/div&gt;
	&lt;div class=&quot;lightBox&quot;&gt;
		&lt;span class=&quot;lightBoxMaxHeight&quot;&gt;&lt;/span&gt;
		&lt;div class=&quot;lightBoxContent&quot;&gt;
			&lt;div class=&quot;lightBoxWrapper&quot;&gt;
				当提示小于一行时文字居中&lt;br /&gt;
			&lt;/div&gt;
			&lt;div class=&quot;lightBoxSubmit&quot;&gt;
				&lt;input type=&quot;button&quot; value=&quot;确定&quot; onclick=&quot;hideLayer('lightBox')&quot; /&gt;
				&lt;input type=&quot;button&quot; value=&quot;取消&quot; onclick=&quot;hideLayer('lightBox')&quot; /&gt;
			&lt;/div&gt;
		&lt;/div&gt;
	&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;popupComponent&quot; id=&quot;lightBox2&quot;&gt;
	&lt;iframe class=&quot;popupIframe&quot;&gt;&lt;/iframe&gt;
	&lt;div class=&quot;popupCover&quot;&gt;&lt;/div&gt;
	&lt;div class=&quot;lightBox&quot;&gt;
		&lt;div class=&quot;lightBoxContent&quot;&gt;
			&lt;div class=&quot;lightBoxWrapper&quot;&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
				 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度&lt;br /&gt;
			&lt;/div&gt;
			&lt;div class=&quot;lightBoxSubmit&quot;&gt;
				&lt;input type=&quot;button&quot; value=&quot;确定&quot; onclick=&quot;hideLayer('lightBox2')&quot; /&gt;
				&lt;input type=&quot;button&quot; value=&quot;取消&quot; onclick=&quot;hideLayer('lightBox2')&quot; /&gt;
			&lt;/div&gt;
		&lt;/div&gt;
		&lt;span class=&quot;lightBoxMaxHeight&quot;&gt;&lt;/span&gt;
	&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;myPage&quot;&gt;
	假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;
	&lt;div style=&quot;text-align:center;&quot;&gt;&lt;input type=&quot;button&quot; value=&quot;位于第一屏的按钮&quot; onclick=&quot;showLayer('lightBox')&quot; /&gt;&lt;/div&gt;
	假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;
	&lt;select&gt;&lt;option&gt;一个用于测试IE6中是否能覆盖住的select&lt;/option&gt;&lt;/select&gt;&lt;br /&gt;
	假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;
	假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;
	假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;
	&lt;select&gt;&lt;option&gt;又一个用于测试IE6中是否能覆盖住的select&lt;/option&gt;&lt;/select&gt;&lt;br /&gt;
	假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;
	&lt;div style=&quot;text-align:center;&quot;&gt;&lt;input type=&quot;button&quot; value=&quot;位于第二屏中的按钮&quot; onclick=&quot;showLayer('lightBox')&quot; /&gt;&lt;input type=&quot;button&quot; value=&quot;当内容已经超过了一屏的高度&quot; onclick=&quot;showLayer('lightBox2')&quot; /&gt;&lt;/div&gt;
	假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;
	假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;
	假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;
&lt;/div&gt;
&lt;script&gt;
function showLayer(id) {
	document.getElementById(id).style.display = &quot;block&quot;;
}
function hideLayer(id) {
	document.getElementById(id).style.display = &quot;none&quot;;
}
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_CxGO3F');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_CxGO3F');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>这个lightBox具备以下特性，大家可以通过修改代码测一测 ^-^：<br />
1. 在页面中任意一位置点开，均能完美遮屏（此时无法直接控制包括滚动条在内的任意元素），IE6中无须隐藏即能遮蔽select元素（iframe遮蔽法的缺陷：遮蔽后，如果拖动滚动条，select仍会移至顶层）。<br />
2. lightBox的高度自适应其内容，并呈现完美的居中状态。<br />
3. 内容为单行时，居中显示；内容为多行时，居左显示；内容高度使lightBox超过屏高时呈现滚动条，并居顶显示，读者能完整阅读。</p>
<p>如有兴趣，构成这个lightBox的以下小技巧可供您参详：</p>
<p>1. 全屏遮蔽的方法：</p>
<p>A. 隐藏html/body的滚动条。<br />
B. 用一个div做遮罩，再用一个div做带有滚动条的页面，一个叠上面，一个叠下面。</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_ZOeWLk">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;全屏遮蔽的方法&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* {
	margin:0; padding:0; /*--- 简单的css reset，据说它的效率不高，请自行替换为高效的 ---*/
}
html,body {
	height:100%; /*--- 有了这个高度，IE6下，body的子对象设置height:100%才有效 ---*/
	overflow:hidden; /*--- 灭掉html或body产生的滚动条 ---*/
}
.page {
	line-height:3;
	overflow:auto; /*--- 滚动条就靠它了 ---*/
	width:600px; height:400px; background:#f60; /*--- 暂时先做这么大，方便大家看清楚 ---*/
	position:relative; left:50px; top:50px; /*--- 移动一点点，方便大家看清楚，把它去掉，遮罩的基本的效果就实现了 ---*/
}
.cover {
	position:absolute;
	width:600px; height:400px; background:#000;
	opacity:0.7; *filter:alpha(opacity=70);
	z-index:2;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;cover&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;page&quot;&gt;
	假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;
	假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;
	假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;
	假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;
	假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;
	假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;
	假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;
	假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;
	假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;假装很丰富的内容&lt;br /&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_ZOeWLk');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_ZOeWLk');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>2. 单行居中，多行居左的方法（看demo吧，表述能力有限）：</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_NdIlvc">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;单行居中，多行居左&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* {
	margin:0; padding:0;
}
.outer { margin-top:20px; text-align:center;}
.inner { display:inline-block; *display:inline; zoom:1; text-align:left;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;outer&quot;&gt;
	&lt;div class=&quot;inner&quot;&gt;内容很少时&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;outer&quot;&gt;
	&lt;div class=&quot;inner&quot;&gt;
		&lt;p&gt;内容成段时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时时&lt;/p&gt;
	&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_NdIlvc');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_NdIlvc');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>3. 使用inline-block实现未知高度垂直居中的方法（看图和demo吧，表述能力有限）：</p>
<p>图示：<br />
<img src="http://www.14px.com/wp-content/uploads/2009/07/inlineblockverticalalignmiddle.gif" alt="使用inline-block实现未知高度垂直居中的方法" /></p>
<p>代码演示：</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_RneLLg">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;未知高度垂直居中的方法&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* { margin:0; padding:0;}
html,body {  height:100%; overflow:hidden; text-align:center; font-size:0; }
.maxHeight { display:inline-block; *display:inline; *zoom:1; height:100%; width:10px; vertical-align:middle; background:#00b4ff; margin-left:-10px;}
.lightBox { display:inline-block; *display:inline; *zoom:1; width:300px; border:2px solid #f60; font-size:12px; background:#fff; position:relative;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;lightBox&quot;&gt;
	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div class=&quot;maxHeight&quot;&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_RneLLg');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_RneLLg');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>存在的两个细节性问题：<br />
1. 大家可以看到完整demo中并未出现font-size:0;，而在垂直居中法中却出现了。<br />
因为font-size:0在完整demo中，将使firefox3.5中读者完整阅读时lightBox的鼠标滚轮失效，原因不详，这一点大家可以作情处理。<br />
2. maxHeight这东西只能放在lightBoxContent的后面，因为在opera9.6中会出现bug，囧。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.14px.com/?feed=rss2&amp;p=183</wfw:commentRss>
		</item>
		<item>
		<title>在ie6下实现position-fixed的效果</title>
		<link>http://www.14px.com/?p=173</link>
		<comments>http://www.14px.com/?p=173#comments</comments>
		<pubDate>Wed, 27 May 2009 14:25:03 +0000</pubDate>
		<dc:creator>Chomo</dc:creator>
		
		<category><![CDATA[xhtml+css]]></category>

		<category><![CDATA[position]]></category>

		<guid isPermaLink="false">http://www.14px.com/?p=173</guid>
		<description><![CDATA[[参与测试的浏览器：IE6 / IE7 / IE8 / FF3 / OP9.6 / SF3 / Chrome2 ]
[操作系统：Windows]
我喜欢position:fixed，它很酷。
但ie6总不支持它，所以用其他的属性来模拟（这个模拟在主流浏览器中都兼容，所以其他浏览器也不需要分开写position:fixed了）。
看效果先：

&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62;
&#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&#62;
&#60;head&#62;
&#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=utf-8&#34; /&#62;
&#60;meta name=&#34;author&#34; content=&#34;Chomo&#34; /&#62;
&#60;link rel=&#34;start&#34; href=&#34;http://www.14px.com&#34; title=&#34;Home&#34; /&#62;
&#60;title&#62;模拟position:fixed&#60;/title&#62;
&#60;/head&#62;
&#60;style&#62;
* { padding:0; margin:0;}
body { height:100%; overflow:hidden; font-size:14px; line-height:2; position:relative;}
html { height:100%; overflow:hidden;}
.fixed { position:absolute; top:10px; left:10px; width:200px; height:350px; background:#fc0; border:1px solid #f60;}
.wrapper [...]]]></description>
			<content:encoded><![CDATA[<p>[参与测试的浏览器：IE6 / IE7 / IE8 / FF3 / OP9.6 / SF3 / Chrome2 ]<br />
[操作系统：Windows]</p>
<p>我喜欢position:fixed，它很酷。<br />
但ie6总不支持它，所以用其他的属性来模拟（这个模拟在主流浏览器中都兼容，所以其他浏览器也不需要分开写position:fixed了）。<br />
看效果先：</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_rQrYRD">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;模拟position:fixed&lt;/title&gt;
&lt;/head&gt;
&lt;style&gt;
* { padding:0; margin:0;}
body { height:100%; overflow:hidden; font-size:14px; line-height:2; position:relative;}
html { height:100%; overflow:hidden;}
.fixed { position:absolute; top:10px; left:10px; width:200px; height:350px; background:#fc0; border:1px solid #f60;}
.wrapper { height:100%; overflow:auto;}
.body { padding-top:10px; margin-left:232px;}
&lt;/style&gt;
&lt;body&gt;
&lt;div class=&quot;fixed&quot;&gt;滚动条就算蹦达出窗口它都不会动的&lt;/div&gt;
&lt;div class=&quot;wrapper&quot;&gt;
	&lt;div class=&quot;body&quot;&gt;
		[专业 » 产业观察] 彩虹显IP怕成被告？TX给彩虹暗示？  jarry 2008-11-17 &lt;br /&gt;
		[专业 » 产业观察] 上海东楼Kappa女：互联网的作用＝炒作？  jarry 2008-11-13 &lt;br /&gt;
		[专业 » 产业观察] 全球性商务人脉网络平台：XING.com  jarry 2008-11-1 &lt;br /&gt;
		[专业 » 产业观察] 什么是口碑营销？  jarry 2008-10-17 &lt;br /&gt;
		[专业 » 产业观察] 第二届 Open Web 大赛开幕  jarry 2008-10-16 &lt;br /&gt;
		[专业 » 产业观察] 百度有啊C2C网络交易平台即将上线  jarry 2008-10-12 &lt;br /&gt;
		[专业 » 产业观察] 首款谷歌Android手机高调上市  jarry 2008-10-10 &lt;br /&gt;
		[专业 » 产业观察] 七个获得订阅用户的黑色真理  jarry 2008-10-8 &lt;br /&gt;
		[专业 » 产业观察] 靠写博客赚钱的五个必要条件  jarry 2008-10-7 &lt;br /&gt;
		[专业 » 产业观察] Windows Live Messenger 9 Wave3 最终发布日期确定  jarry 2008-10-6 &lt;br /&gt;
		[专业 » 产业观察] 2008中国互联网大会昨日开幕  jarry 2008-9-24 &lt;br /&gt;
		[专业 » 产业观察] 有道热闻上线！  jarry 2008-9-19 &lt;br /&gt;
		[专业 » 产业观察] Phpcms 2008 测试版9月1日开源免费发布  jarry 2008-9-17 &lt;br /&gt;
		[专业 » 产业观察] 电脑报介绍的adobe air应用  jarry 2008-9-10 &lt;br /&gt;
		[专业 » 产业观察] WordCamp China 2008即将召开  jarry 2008-8-28 &lt;br /&gt;
		[专业 » 产业观察] 开发硬件防火墙的主要步骤  jarry 2008-8-11 &lt;br /&gt;
		[专业 » 产业观察] 细数20个Windows 7应该拥有的功能 - Windows 7之家--iWindows7.com  jarry 2008-8-6 &lt;br /&gt;
		[专业 » 产业观察] 互联网运营者和互联网评论者  jarry 2008-6-22 &lt;br /&gt;
		[专业 » 产业观察] 有趣的BlogBus暂停服务提示  jarry 2008-6-12 &lt;br /&gt;
		[专业 » 产业观察] 谁收入最高？程序员收入大比拼  jarry 2008-6-11 &lt;br /&gt;
		[专业 » 产业观察] Blog营销的特征  jarry 2008-6-10 &lt;br /&gt;
		[专业 » 产业观察] 推荐一个文内广告平台：群视  jarry 2008-6-8 &lt;br /&gt;
		[专业 » 产业观察] Google官方解释为何更换小图标  jarry 2008-6-8 &lt;br /&gt;
		[专业 » 产业观察] 二十年前的1GB  jarry 2008-6-8 &lt;br /&gt;
		[专业 » 产业观察] 【pr=7，震古铄今，PR=8，天人合一】PR境界谈  jarry 2008-6-8 &lt;br /&gt;
		[专业 » 产业观察] 大网站谎言，你有没有被欺骗过  jarry 2008-6-8 &lt;br /&gt;
		[专业 » 产业观察] blog.35免费绑定域名的wp服务  jarry 2008-6-7 &lt;br /&gt;
		[专业 » 产业观察] 腾讯SNS：QQ校友开始内测  jarry 2008-6-7 &lt;br /&gt;
		[专业 » 产业观察] 衡量博客价值七个指标  jarry 2008-6-6 &lt;br /&gt;
		[专业 » 产业观察] 另类思维：百度是嫖客 我（站长）要学会做小姐  jarry 2008-6-6 &lt;br /&gt;
		[专业 » 产业观察] 中国电信承接CDMA后的运营策略  jarry 2008-6-5 &lt;br /&gt;
		[专业 » 产业观察] 微软新系统Windows 7桌面截图（16pics）  jarry 2008-6-5 &lt;br /&gt;
		[专业 » 产业观察] 3G门户：无线互联网门户网站  jarry 2008-6-5 &lt;br /&gt;
		[专业 » 产业观察] Retaggr：个性化名片制作  jarry 2008-6-3 &lt;br /&gt;
		[专业 » 产业观察] Acrobat：Adobe的网络办公室  jarry 2008-6-3 &lt;br /&gt;
		[专业 » 产业观察] 影响博客互动运营的八大因素  jarry 2008-6-2 &lt;br /&gt;
		[专业 » 产业观察] 影响中国人通讯习惯的十家公司  jarry 2008-6-2 &lt;br /&gt;
		[专业 » 产业观察] 5月浏览器大战升级 FireFox 3份额提升  jarry 2008-6-2 &lt;br /&gt;
		[专业 » 产业观察] 为什么很多博客赚不到钱?  jarry 2008-5-31 &lt;br /&gt;
		[专业 » 产业观察] VIA OpenBook迷你笔记本实物图  jarry 2008-5-31 &lt;br /&gt;
		[专业 » 产业观察] 人肉搜索：天使还是魔鬼？  jarry 2008-5-30 &lt;br /&gt;
		[专业 » 产业观察] 360doc：个人图书馆，网页在线收藏  jarry 2008-5-30 &lt;br /&gt;
		[专业 » 产业观察] 时光网：电影、社区、你和我  jarry 2008-5-30 &lt;br /&gt;
		[专业 » 产业观察] 十大最让人恼火的软件  jarry 2008-5-27 &lt;br /&gt;
		[专业 » 产业观察] 付钱让员工辞职，Zappos 的成功秘诀  jarry 2008-5-27 &lt;br /&gt;
		[专业 » 产业观察] 三部委发布电信业重组公告 完成后发三张3G牌照  jarry 2008-5-25 &lt;br /&gt;
		[专业 » 产业观察] QQ网络硬盘网页版秘密发布  jarry 2008-5-25 &lt;br /&gt;
		[专业 » 产业观察] Google Sites开始向所有人免费开放 建立自己的个人主页  jarry 2008-5-23 &lt;br /&gt;
		[专业 » 产业观察] 10个不为人知的Google失败作品  jarry 2008-5-22 &lt;br /&gt;
		[专业 » 产业观察] C2Call：基于Web浏览器的网络电话服务  jarry 2008-5-21 &lt;br /&gt;
		[专业 » 产业观察] 微软放弃Vista 用Windows 7取而代之  jarry 2008-5-21 &lt;br /&gt;
		[专业 » 产业观察] 2008年不可错过的Web2.0产品  jarry 2008-5-21 &lt;br /&gt;
		[专业 » 产业观察] 在 Google Earth 上看新闻  jarry 2008-5-21 &lt;br /&gt;
		[专业 » 产业观察] 全国哀悼日CCTV启用wenchuan.cn域名  jarry 2008-5-20 &lt;br /&gt;
		[专业 » 产业观察] 微软抗衡谷歌计划:200亿并购Facebook  jarry 2008-5-20 &lt;br /&gt;
		[专业 » 产业观察] 还有什么不能卖？－ebay 十大火星拍卖  jarry 2008-5-19 &lt;br /&gt;
		[专业 » 产业观察] 互联网营销——互联网是手段，营销才是本质  jarry 2008-5-13 &lt;br /&gt;
		[专业 » 产业观察] 中移动手机邮箱也抄袭？  jarry 2007-11-2 &lt;br /&gt;
		[专业 » 产业观察] TNND，要彻底放弃MSN了。  jarry 2007-6-11 &lt;br /&gt;
		[专业 » 产业观察] 好玩的在线工具  jarry 2006-11-11 &lt;br /&gt;
		[专业 » 产业观察] 让收费网站去死吧，用google 突破！！  jarry 2005-11-20 &lt;br /&gt;
	&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_rQrYRD');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_rQrYRD');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>这是基于这种方法做的对联效果：</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_BMixC8">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;title&gt;利用模拟的position:fixed做的对联&lt;/title&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;/head&gt;
&lt;style&gt;
* { padding:0; margin:0;}
body { height:100%; overflow:hidden; font-size:14px; line-height:2; position:relative;}
html { height:100%; overflow:hidden;}
.fixed { position:absolute; top:10px; left:50%; width:100px; margin-left:-490px; height:350px; background:#fc0; border:1px solid #f60;}
.fixed2 { position:absolute; top:10px; left:50%; width:100px; margin-left:370px; height:350px; background:#fc0; border:1px solid #f60;}
.wrapper { height:100%; overflow:auto; overflow-y:scroll;}
.body { width:700px; margin:0 auto; background:#f2f2f2; padding:20px;}
&lt;/style&gt;
&lt;body&gt;
&lt;div class=&quot;fixed&quot;&gt;猪坚强&lt;/div&gt;
&lt;div class=&quot;fixed2&quot;&gt;又一个猪坚强&lt;/div&gt;
&lt;div class=&quot;wrapper&quot;&gt;
	&lt;div class=&quot;body&quot;&gt;
		[专业 » 产业观察] 彩虹显IP怕成被告？TX给彩虹暗示？  jarry 2008-11-17 &lt;br /&gt;
		[专业 » 产业观察] 上海东楼Kappa女：互联网的作用＝炒作？  jarry 2008-11-13 &lt;br /&gt;
		[专业 » 产业观察] 全球性商务人脉网络平台：XING.com  jarry 2008-11-1 &lt;br /&gt;
		[专业 » 产业观察] 什么是口碑营销？  jarry 2008-10-17 &lt;br /&gt;
		[专业 » 产业观察] 第二届 Open Web 大赛开幕  jarry 2008-10-16 &lt;br /&gt;
		[专业 » 产业观察] 百度有啊C2C网络交易平台即将上线  jarry 2008-10-12 &lt;br /&gt;
		[专业 » 产业观察] 首款谷歌Android手机高调上市  jarry 2008-10-10 &lt;br /&gt;
		[专业 » 产业观察] 七个获得订阅用户的黑色真理  jarry 2008-10-8 &lt;br /&gt;
		[专业 » 产业观察] 靠写博客赚钱的五个必要条件  jarry 2008-10-7 &lt;br /&gt;
		[专业 » 产业观察] Windows Live Messenger 9 Wave3 最终发布日期确定  jarry 2008-10-6 &lt;br /&gt;
		[专业 » 产业观察] 2008中国互联网大会昨日开幕  jarry 2008-9-24 &lt;br /&gt;
		[专业 » 产业观察] 有道热闻上线！  jarry 2008-9-19 &lt;br /&gt;
		[专业 » 产业观察] Phpcms 2008 测试版9月1日开源免费发布  jarry 2008-9-17 &lt;br /&gt;
		[专业 » 产业观察] 电脑报介绍的adobe air应用  jarry 2008-9-10 &lt;br /&gt;
		[专业 » 产业观察] WordCamp China 2008即将召开  jarry 2008-8-28 &lt;br /&gt;
		[专业 » 产业观察] 开发硬件防火墙的主要步骤  jarry 2008-8-11 &lt;br /&gt;
		[专业 » 产业观察] 细数20个Windows 7应该拥有的功能 - Windows 7之家--iWindows7.com  jarry 2008-8-6 &lt;br /&gt;
		[专业 » 产业观察] 互联网运营者和互联网评论者  jarry 2008-6-22 &lt;br /&gt;
		[专业 » 产业观察] 有趣的BlogBus暂停服务提示  jarry 2008-6-12 &lt;br /&gt;
		[专业 » 产业观察] 谁收入最高？程序员收入大比拼  jarry 2008-6-11 &lt;br /&gt;
		[专业 » 产业观察] Blog营销的特征  jarry 2008-6-10 &lt;br /&gt;
		[专业 » 产业观察] 推荐一个文内广告平台：群视  jarry 2008-6-8 &lt;br /&gt;
		[专业 » 产业观察] Google官方解释为何更换小图标  jarry 2008-6-8 &lt;br /&gt;
		[专业 » 产业观察] 二十年前的1GB  jarry 2008-6-8 &lt;br /&gt;
		[专业 » 产业观察] 【pr=7，震古铄今，PR=8，天人合一】PR境界谈  jarry 2008-6-8 &lt;br /&gt;
		[专业 » 产业观察] 大网站谎言，你有没有被欺骗过  jarry 2008-6-8 &lt;br /&gt;
		[专业 » 产业观察] blog.35免费绑定域名的wp服务  jarry 2008-6-7 &lt;br /&gt;
		[专业 » 产业观察] 腾讯SNS：QQ校友开始内测  jarry 2008-6-7 &lt;br /&gt;
		[专业 » 产业观察] 衡量博客价值七个指标  jarry 2008-6-6 &lt;br /&gt;
		[专业 » 产业观察] 另类思维：百度是嫖客 我（站长）要学会做小姐  jarry 2008-6-6 &lt;br /&gt;
		[专业 » 产业观察] 中国电信承接CDMA后的运营策略  jarry 2008-6-5 &lt;br /&gt;
		[专业 » 产业观察] 微软新系统Windows 7桌面截图（16pics）  jarry 2008-6-5 &lt;br /&gt;
		[专业 » 产业观察] 3G门户：无线互联网门户网站  jarry 2008-6-5 &lt;br /&gt;
		[专业 » 产业观察] Retaggr：个性化名片制作  jarry 2008-6-3 &lt;br /&gt;
		[专业 » 产业观察] Acrobat：Adobe的网络办公室  jarry 2008-6-3 &lt;br /&gt;
		[专业 » 产业观察] 影响博客互动运营的八大因素  jarry 2008-6-2 &lt;br /&gt;
		[专业 » 产业观察] 影响中国人通讯习惯的十家公司  jarry 2008-6-2 &lt;br /&gt;
		[专业 » 产业观察] 5月浏览器大战升级 FireFox 3份额提升  jarry 2008-6-2 &lt;br /&gt;
		[专业 » 产业观察] 为什么很多博客赚不到钱?  jarry 2008-5-31 &lt;br /&gt;
		[专业 » 产业观察] VIA OpenBook迷你笔记本实物图  jarry 2008-5-31 &lt;br /&gt;
		[专业 » 产业观察] 人肉搜索：天使还是魔鬼？  jarry 2008-5-30 &lt;br /&gt;
		[专业 » 产业观察] 360doc：个人图书馆，网页在线收藏  jarry 2008-5-30 &lt;br /&gt;
		[专业 » 产业观察] 时光网：电影、社区、你和我  jarry 2008-5-30 &lt;br /&gt;
		[专业 » 产业观察] 十大最让人恼火的软件  jarry 2008-5-27 &lt;br /&gt;
		[专业 » 产业观察] 付钱让员工辞职，Zappos 的成功秘诀  jarry 2008-5-27 &lt;br /&gt;
		[专业 » 产业观察] 三部委发布电信业重组公告 完成后发三张3G牌照  jarry 2008-5-25 &lt;br /&gt;
		[专业 » 产业观察] QQ网络硬盘网页版秘密发布  jarry 2008-5-25 &lt;br /&gt;
		[专业 » 产业观察] Google Sites开始向所有人免费开放 建立自己的个人主页  jarry 2008-5-23 &lt;br /&gt;
		[专业 » 产业观察] 10个不为人知的Google失败作品  jarry 2008-5-22 &lt;br /&gt;
		[专业 » 产业观察] C2Call：基于Web浏览器的网络电话服务  jarry 2008-5-21 &lt;br /&gt;
		[专业 » 产业观察] 微软放弃Vista 用Windows 7取而代之  jarry 2008-5-21 &lt;br /&gt;
		[专业 » 产业观察] 2008年不可错过的Web2.0产品  jarry 2008-5-21 &lt;br /&gt;
		[专业 » 产业观察] 在 Google Earth 上看新闻  jarry 2008-5-21 &lt;br /&gt;
		[专业 » 产业观察] 全国哀悼日CCTV启用wenchuan.cn域名  jarry 2008-5-20 &lt;br /&gt;
		[专业 » 产业观察] 微软抗衡谷歌计划:200亿并购Facebook  jarry 2008-5-20 &lt;br /&gt;
		[专业 » 产业观察] 还有什么不能卖？－ebay 十大火星拍卖  jarry 2008-5-19 &lt;br /&gt;
		[专业 » 产业观察] 互联网营销——互联网是手段，营销才是本质  jarry 2008-5-13 &lt;br /&gt;
		[专业 » 产业观察] 中移动手机邮箱也抄袭？  jarry 2007-11-2 &lt;br /&gt;
		[专业 » 产业观察] TNND，要彻底放弃MSN了。  jarry 2007-6-11 &lt;br /&gt;
		[专业 » 产业观察] 好玩的在线工具  jarry 2006-11-11 &lt;br /&gt;
		[专业 » 产业观察] 让收费网站去死吧，用google 突破！！  jarry 2005-11-20 &lt;br /&gt;
	&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_BMixC8');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_BMixC8');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>原理如下：</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_BohPoJ">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;模拟position:fixed效果的原理&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
div { height:100px; width:100px; overflow:auto; border:1px solid #000;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;
↑你滚你的，我雷打不动
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_BohPoJ');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_BohPoJ');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>把框框的高宽都扩大到100%，然后将雷打不动的文字定个位就行了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.14px.com/?feed=rss2&amp;p=173</wfw:commentRss>
		</item>
		<item>
		<title>表格外观的无序列表</title>
		<link>http://www.14px.com/?p=164</link>
		<comments>http://www.14px.com/?p=164#comments</comments>
		<pubDate>Mon, 25 May 2009 17:10:43 +0000</pubDate>
		<dc:creator>Chomo</dc:creator>
		
		<category><![CDATA[xhtml+css]]></category>

		<category><![CDATA[ul]]></category>

		<category><![CDATA[实例]]></category>

		<guid isPermaLink="false">http://www.14px.com/?p=164</guid>
		<description><![CDATA[[参与测试的浏览器：IE6 / IE7 / IE8 / FF3 / OP9.6 / SF3 / Chrome2 ]
[操作系统：Windows]
别看有的东东长得个表格样，其实是披着表格皮的无序列表，为了伟大的语义，我们需要用css实现表格外观的无序列表。
个人喜好，这里采用border和negative margin来实现，非常简单：

&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62;
&#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&#62;
&#60;head&#62;
&#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=utf-8&#34; /&#62;
&#60;meta name=&#34;author&#34; content=&#34;Chomo&#34; /&#62;
&#60;link rel=&#34;start&#34; href=&#34;http://www.14px.com&#34; title=&#34;Home&#34; /&#62;
&#60;title&#62;表格外观的无序列表 - 原始状态&#60;/title&#62;
&#60;style type=&#34;text/css&#34;&#62;
* { margin:0; padding:0; list-style:none;}
ul { margin-left:1px; margin-top:1px; width:505px;}
li { float:left; height:23px; border:1px solid #cfdae8; width:100px; margin-left:-1px; margin-top:-1px;}
&#60;/style&#62;
&#60;/head&#62;
&#60;body&#62;
&#60;ul&#62;
	&#60;li&#62;&#60;/li&#62;
	&#60;li&#62;&#60;/li&#62;
	&#60;li&#62;&#60;/li&#62;
	&#60;li&#62;&#60;/li&#62;
	&#60;li&#62;&#60;/li&#62;
	&#60;li&#62;&#60;/li&#62;
	&#60;li&#62;&#60;/li&#62;
	&#60;li&#62;&#60;/li&#62;
	&#60;li&#62;&#60;/li&#62;
	&#60;li&#62;&#60;/li&#62;
	&#60;li&#62;&#60;/li&#62;
	&#60;li&#62;&#60;/li&#62;
	&#60;li&#62;&#60;/li&#62;
	&#60;li&#62;&#60;/li&#62;
	&#60;li&#62;&#60;/li&#62;
	&#60;li&#62;&#60;/li&#62;
	&#60;li&#62;&#60;/li&#62;
	&#60;li&#62;&#60;/li&#62;
	&#60;li&#62;&#60;/li&#62;
	&#60;li&#62;&#60;/li&#62;
&#60;/ul&#62;
&#60;br /&#62;&#60;br [...]]]></description>
			<content:encoded><![CDATA[<p>[参与测试的浏览器：IE6 / IE7 / IE8 / FF3 / OP9.6 / SF3 / Chrome2 ]<br />
[操作系统：Windows]</p>
<p>别看有的东东长得个表格样，其实是披着表格皮的无序列表，为了伟大的语义，我们需要用css实现表格外观的无序列表。</p>
<p>个人喜好，这里采用border和negative margin来实现，非常简单：</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_Lh2pyS">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;表格外观的无序列表 - 原始状态&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* { margin:0; padding:0; list-style:none;}
ul { margin-left:1px; margin-top:1px; width:505px;}
li { float:left; height:23px; border:1px solid #cfdae8; width:100px; margin-left:-1px; margin-top:-1px;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;br /&gt;像一个表格吧？ ^-^
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_Lh2pyS');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_Lh2pyS');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>这是一个最简单的模型，然而，实战总是残酷的：</p>
<ol>
<li>宽度如何自适应分辨率？</li>
<li>单元格内容过多、形成换行如何处理？</li>
<li>最纠结的问题：5×4的表格，如果只有17条数据怎么办？empty-cell也黯然失色…</li>
</ol>
<p><strong>问题1：</strong>宽度如何自适应分辨率？<br />
这个问题也许有人说没必要，但是在模块化设计时，几乎任何部件都被要求设置为宽度自适应模式的。</p>
<p><strong>解决1：</strong>参考完美的firefox3和ie8百分比宽度处理方案，给剩余的宽度分配给某个“列”，就行了 ^-^<br />
记得二列等高的笨办法吗？——用背景图片模拟。</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_c4o4iB">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;表格外观的无序列表 - 解决宽度自适应问题&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* { margin:0; padding:0; list-style:none;}
ul { border:1px solid #cfdae8; border-left:none; border-bottom:none; overflow:hidden; background:url(http://www.14px.com/wp-content/uploads/2009/05/1.gif); zoom:1;}
li { width:20%; *width:19.9%;/*IE6&amp;IE7的宽度有点点囧*/ float:left;}
span { display:block; border-left:1px solid #cfdae8; height:24px; font-size:12px; line-height:24px; padding:0 4px;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;br /&gt;宽度自适应问题解决了，请拖着浏览器的窗口边框，放肆扯吧~
&lt;/body&gt;
&lt;/html&gt;
</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_c4o4iB');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_c4o4iB');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p><strong>问题2：</strong>单元格内容过多、形成换行如何处理？</p>
<p><strong>解决2：</strong>隐藏吧，它已经没有存在的价值了！（ - -! 其实是我想不出别的办法来了）<br />
但为了体验好一点，我加上了text-overflow。这个，FF暂时不支持……<a href="http://www.aoao.org.cn/blog/2008/07/firefox-text-overflow-ellipsis/" target="_blank">aoao有好的解决办法</a>，我也有<a href="http://bbs.blueidea.com/thread-2915238-1-1.html" target="_blank">次点的解决办法</a>和一个完美的解决办法（目前YY中，且仅FF3.5支持）。</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_PpPGHN">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;表格外观的无序列表 - 过剩文字的处理&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* { margin:0; padding:0; list-style:none;}
ul { border:1px solid #cfdae8; border-left:none; border-bottom:none; overflow:hidden; background:url(http://www.14px.com/wp-content/uploads/2009/05/1.gif); zoom:1;}
li { width:20%; *width:19.9%;/*IE6&amp;IE7的宽度有点点囧*/ float:left;}
span { display:block; border-left:1px solid #cfdae8; height:24px; font:12px/24px tahoma; padding:0 4px;}
a { white-space:nowrap; display:block; width:100%; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; color:#000; text-decoration:none;}
a:hover { color:#f60;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Prison Break / 越狱&quot; href=&quot;#nogo&quot;&gt;Prison Break / 越狱 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Gossip Girl / 八卦天后&quot; href=&quot;#nogo&quot;&gt;Gossip Girl / 八卦天后 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Friends / 老友记 / 六人行&quot; href=&quot;#nogo&quot;&gt;Friends / 老友记 / 六人行&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Heroes / 超能英雄&quot; href=&quot;#nogo&quot;&gt;Heroes / 超能英雄&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Desperate Housewives / 绝望的主妇&quot; href=&quot;#nogo&quot;&gt;Desperate Housewives / 绝望的主妇 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Sex and the City / 欲望都市&quot; href=&quot;#nogo&quot;&gt;Sex and the City / 欲望都市 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Prison Break: Proof of Innocence / 越狱 第二季&quot; href=&quot;#nogo&quot;&gt;Prison Break: Proof of Innocence / 越狱 第二季&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Lost / 迷失&quot; href=&quot;#nogo&quot;&gt;Lost / 迷失&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Grey's Anatomy / 实习医生格蕾 / 格蕾的解剖&quot; href=&quot;#nogo&quot;&gt;Grey's Anatomy / 实习医生格蕾 / 格蕾的解剖 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Lie to Me / 千谎百计&quot; href=&quot;#nogo&quot;&gt;Lie to Me / 千谎百计 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;The Big Bang Theory / 天才理论传 / 生活大爆炸&quot; href=&quot;#nogo&quot;&gt;The Big Bang Theory / 天才理论传 / 生活大爆炸 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Growing Pains / 成长的烦恼&quot; href=&quot;#nogo&quot;&gt;Growing Pains / 成长的烦恼 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Prison Break (Season 3) / 越狱 第三季&quot; href=&quot;#nogo&quot;&gt;Prison Break (Season 3) / 越狱 第三季&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;House M.D. / 怪杰医生豪斯 / 豪斯医生&quot; href=&quot;#nogo&quot;&gt;House M.D. / 怪杰医生豪斯 / 豪斯医生 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Ugly Betty / 丑女贝蒂&quot; href=&quot;#nogo&quot;&gt;Ugly Betty / 丑女贝蒂 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Gossip Girl season2 / 八卦天后 第二季&quot; href=&quot;#nogo&quot;&gt;Gossip Girl season2 / 八卦天后 第二季&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;CSI: Crime Scene Investigation / 犯罪现场：拉斯维加斯&quot; href=&quot;#nogo&quot;&gt;CSI: Crime Scene Investigation / 犯罪现场：拉斯维加斯&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Heroes(Season 2) / 天骄 / 超能英雄&quot; href=&quot;#nogo&quot;&gt;Heroes(Season 2) / 天骄 / 超能英雄 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;24 / 24反恐部队 / 24小时&quot; href=&quot;#nogo&quot;&gt;24 / 24反恐部队 / 24小时&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Cashmere Mafia / 女人帮&quot; href=&quot;#nogo&quot;&gt;Cashmere Mafia / 女人帮 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;br /&gt;实际应用的时候，通过对单元文字长度范围的预测、应用区域宽度的结合考虑，可通过调整列数来达到我们想要的效果。
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_PpPGHN');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_PpPGHN');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p><strong>问题3：</strong>5×4的表格，如果只有17条数据怎么办？empty-cell也黯然失色…<br />
看这个Demo，其实我觉得这个样子不影响阅读，也不难看了，可Boss和他的Money不乐意。</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_JgGLET">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;表格外观的无序列表 - 5×4的表格，如果只有17条数据怎么办？&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* { margin:0; padding:0; list-style:none;}
ul { border:1px solid #cfdae8; border-left:none; border-bottom:none; overflow:hidden; background:url(http://www.14px.com/wp-content/uploads/2009/05/1.gif); zoom:1;}
li { width:20%; *width:19.9%;/*IE6&amp;IE7的宽度有点点囧*/ float:left;}
span { display:block; border-left:1px solid #cfdae8; height:24px; font:12px/24px tahoma; padding:0 4px;}
a { white-space:nowrap; display:block; width:100%; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; color:#000; text-decoration:none;}
a:hover { color:#f60;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Prison Break / 越狱&quot; href=&quot;#nogo&quot;&gt;Prison Break / 越狱 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Gossip Girl / 八卦天后&quot; href=&quot;#nogo&quot;&gt;Gossip Girl / 八卦天后 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Friends / 老友记 / 六人行&quot; href=&quot;#nogo&quot;&gt;Friends / 老友记 / 六人行&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Heroes / 超能英雄&quot; href=&quot;#nogo&quot;&gt;Heroes / 超能英雄&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Desperate Housewives / 绝望的主妇&quot; href=&quot;#nogo&quot;&gt;Desperate Housewives / 绝望的主妇 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Sex and the City / 欲望都市&quot; href=&quot;#nogo&quot;&gt;Sex and the City / 欲望都市 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Prison Break: Proof of Innocence / 越狱 第二季&quot; href=&quot;#nogo&quot;&gt;Prison Break: Proof of Innocence / 越狱 第二季&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Lost / 迷失&quot; href=&quot;#nogo&quot;&gt;Lost / 迷失&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Grey's Anatomy / 实习医生格蕾 / 格蕾的解剖&quot; href=&quot;#nogo&quot;&gt;Grey's Anatomy / 实习医生格蕾 / 格蕾的解剖 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Lie to Me / 千谎百计&quot; href=&quot;#nogo&quot;&gt;Lie to Me / 千谎百计 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;The Big Bang Theory / 天才理论传 / 生活大爆炸&quot; href=&quot;#nogo&quot;&gt;The Big Bang Theory / 天才理论传 / 生活大爆炸 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Growing Pains / 成长的烦恼&quot; href=&quot;#nogo&quot;&gt;Growing Pains / 成长的烦恼 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Prison Break (Season 3) / 越狱 第三季&quot; href=&quot;#nogo&quot;&gt;Prison Break (Season 3) / 越狱 第三季&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;House M.D. / 怪杰医生豪斯 / 豪斯医生&quot; href=&quot;#nogo&quot;&gt;House M.D. / 怪杰医生豪斯 / 豪斯医生 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Ugly Betty / 丑女贝蒂&quot; href=&quot;#nogo&quot;&gt;Ugly Betty / 丑女贝蒂 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Gossip Girl season2 / 八卦天后 第二季&quot; href=&quot;#nogo&quot;&gt;Gossip Girl season2 / 八卦天后 第二季&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;CSI: Crime Scene Investigation / 犯罪现场：拉斯维加斯&quot; href=&quot;#nogo&quot;&gt;CSI: Crime Scene Investigation / 犯罪现场：拉斯维加斯&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;br /&gt;其实我觉得这个样子不影响阅读，也不难看了，可Boss和他的Money不乐意。
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_JgGLET');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_JgGLET');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p><strong>解决3：</strong><br />
首先让我们制造出我们想要的表格（很遗憾，制造了很多空标签，暂时没有找到更合适的纯CSS解决方案，欢迎大家多多指点）。</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_Ljhfl9">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;表格外观的无序列表 - 让我们制造出我们想要的表格&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* { margin:0; padding:0; list-style:none;}
ul { border:1px solid #cfdae8; border-left:none; border-bottom:none; overflow:hidden; background:url(http://www.14px.com/wp-content/uploads/2009/05/1.gif); zoom:1;}
li { width:20%; *width:19.9%;/*IE6&amp;IE7的宽度有点点囧*/ float:left;}
span { display:block; border-left:1px solid #cfdae8; height:24px; font:12px/24px tahoma; padding:0 4px;}
a { white-space:nowrap; display:block; width:100%; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; color:#000; text-decoration:none;}
a:hover { color:#f60;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Prison Break / 越狱&quot; href=&quot;#nogo&quot;&gt;Prison Break / 越狱 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Gossip Girl / 八卦天后&quot; href=&quot;#nogo&quot;&gt;Gossip Girl / 八卦天后 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Friends / 老友记 / 六人行&quot; href=&quot;#nogo&quot;&gt;Friends / 老友记 / 六人行&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Heroes / 超能英雄&quot; href=&quot;#nogo&quot;&gt;Heroes / 超能英雄&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Desperate Housewives / 绝望的主妇&quot; href=&quot;#nogo&quot;&gt;Desperate Housewives / 绝望的主妇 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Sex and the City / 欲望都市&quot; href=&quot;#nogo&quot;&gt;Sex and the City / 欲望都市 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Prison Break: Proof of Innocence / 越狱 第二季&quot; href=&quot;#nogo&quot;&gt;Prison Break: Proof of Innocence / 越狱 第二季&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Lost / 迷失&quot; href=&quot;#nogo&quot;&gt;Lost / 迷失&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Grey's Anatomy / 实习医生格蕾 / 格蕾的解剖&quot; href=&quot;#nogo&quot;&gt;Grey's Anatomy / 实习医生格蕾 / 格蕾的解剖 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Lie to Me / 千谎百计&quot; href=&quot;#nogo&quot;&gt;Lie to Me / 千谎百计 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;The Big Bang Theory / 天才理论传 / 生活大爆炸&quot; href=&quot;#nogo&quot;&gt;The Big Bang Theory / 天才理论传 / 生活大爆炸 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Growing Pains / 成长的烦恼&quot; href=&quot;#nogo&quot;&gt;Growing Pains / 成长的烦恼 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Prison Break (Season 3) / 越狱 第三季&quot; href=&quot;#nogo&quot;&gt;Prison Break (Season 3) / 越狱 第三季&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;House M.D. / 怪杰医生豪斯 / 豪斯医生&quot; href=&quot;#nogo&quot;&gt;House M.D. / 怪杰医生豪斯 / 豪斯医生 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Ugly Betty / 丑女贝蒂&quot; href=&quot;#nogo&quot;&gt;Ugly Betty / 丑女贝蒂 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Gossip Girl season2 / 八卦天后 第二季&quot; href=&quot;#nogo&quot;&gt;Gossip Girl season2 / 八卦天后 第二季&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;CSI: Crime Scene Investigation / 犯罪现场：拉斯维加斯&quot; href=&quot;#nogo&quot;&gt;CSI: Crime Scene Investigation / 犯罪现场：拉斯维加斯&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;br /&gt;很遗憾，制造了很多空标签，暂时没有找到更合适的纯CSS解决方案，欢迎大家多多指点。
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_Ljhfl9');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_Ljhfl9');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>然后用position:relative实现css移魂大法：</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_woqZ4M">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;表格外观的无序列表 - 用position:relative实现css移魂大法&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* { margin:0; padding:0; list-style:none;}
ul { border:1px solid #cfdae8; border-left:none; border-bottom:none; overflow:hidden; background:url(http://www.14px.com/wp-content/uploads/2009/05/1.gif); zoom:1;}
li { width:20%; *width:19.9%;/*IE6&amp;IE7的宽度有点点囧*/ float:left;}
span { display:block; border-left:1px solid #cfdae8; height:24px; font:12px/24px tahoma; padding:0 4px;}
a { white-space:nowrap; display:block; width:100%; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; color:#000; text-decoration:none; position:relative; top:-24px;}
a:hover { color:#f60;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Prison Break / 越狱&quot; href=&quot;#nogo&quot;&gt;Prison Break / 越狱 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Gossip Girl / 八卦天后&quot; href=&quot;#nogo&quot;&gt;Gossip Girl / 八卦天后 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Friends / 老友记 / 六人行&quot; href=&quot;#nogo&quot;&gt;Friends / 老友记 / 六人行&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Heroes / 超能英雄&quot; href=&quot;#nogo&quot;&gt;Heroes / 超能英雄&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Desperate Housewives / 绝望的主妇&quot; href=&quot;#nogo&quot;&gt;Desperate Housewives / 绝望的主妇 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Sex and the City / 欲望都市&quot; href=&quot;#nogo&quot;&gt;Sex and the City / 欲望都市 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Prison Break: Proof of Innocence / 越狱 第二季&quot; href=&quot;#nogo&quot;&gt;Prison Break: Proof of Innocence / 越狱 第二季&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Lost / 迷失&quot; href=&quot;#nogo&quot;&gt;Lost / 迷失&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Grey's Anatomy / 实习医生格蕾 / 格蕾的解剖&quot; href=&quot;#nogo&quot;&gt;Grey's Anatomy / 实习医生格蕾 / 格蕾的解剖 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Lie to Me / 千谎百计&quot; href=&quot;#nogo&quot;&gt;Lie to Me / 千谎百计 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;The Big Bang Theory / 天才理论传 / 生活大爆炸&quot; href=&quot;#nogo&quot;&gt;The Big Bang Theory / 天才理论传 / 生活大爆炸 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Growing Pains / 成长的烦恼&quot; href=&quot;#nogo&quot;&gt;Growing Pains / 成长的烦恼 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Prison Break (Season 3) / 越狱 第三季&quot; href=&quot;#nogo&quot;&gt;Prison Break (Season 3) / 越狱 第三季&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;House M.D. / 怪杰医生豪斯 / 豪斯医生&quot; href=&quot;#nogo&quot;&gt;House M.D. / 怪杰医生豪斯 / 豪斯医生 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Ugly Betty / 丑女贝蒂&quot; href=&quot;#nogo&quot;&gt;Ugly Betty / 丑女贝蒂 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Gossip Girl season2 / 八卦天后 第二季&quot; href=&quot;#nogo&quot;&gt;Gossip Girl season2 / 八卦天后 第二季&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;&lt;a title=&quot;CSI: Crime Scene Investigation / 犯罪现场：拉斯维加斯&quot; href=&quot;#nogo&quot;&gt;CSI: Crime Scene Investigation / 犯罪现场：拉斯维加斯&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_woqZ4M');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_woqZ4M');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>然后让我们隐藏多余的那一行：</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_FwFiNv">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;表格外观的无序列表 - 隐藏多余的一行&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* { margin:0; padding:0; list-style:none;}
div { overflow:hidden; zoom:1;}
ul { border:1px solid #cfdae8; border-left:none; border-bottom:none; overflow:hidden; background:url(http://www.14px.com/wp-content/uploads/2009/05/1.gif); zoom:1; margin-bottom:-24px;}
li { width:20%; *width:19.9%;/*IE6&amp;IE7的宽度有点点囧*/ float:left;}
span { display:block; border-left:1px solid #cfdae8; height:24px; font:12px/24px tahoma; padding:0 4px;}
a { white-space:nowrap; display:block; width:100%; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; color:#000; text-decoration:none; position:relative; top:-24px;}
a:hover { color:#f60;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Prison Break / 越狱&quot; href=&quot;#nogo&quot;&gt;Prison Break / 越狱 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Gossip Girl / 八卦天后&quot; href=&quot;#nogo&quot;&gt;Gossip Girl / 八卦天后 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Friends / 老友记 / 六人行&quot; href=&quot;#nogo&quot;&gt;Friends / 老友记 / 六人行&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Heroes / 超能英雄&quot; href=&quot;#nogo&quot;&gt;Heroes / 超能英雄&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Desperate Housewives / 绝望的主妇&quot; href=&quot;#nogo&quot;&gt;Desperate Housewives / 绝望的主妇 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Sex and the City / 欲望都市&quot; href=&quot;#nogo&quot;&gt;Sex and the City / 欲望都市 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Prison Break: Proof of Innocence / 越狱 第二季&quot; href=&quot;#nogo&quot;&gt;Prison Break: Proof of Innocence / 越狱 第二季&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Lost / 迷失&quot; href=&quot;#nogo&quot;&gt;Lost / 迷失&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Grey's Anatomy / 实习医生格蕾 / 格蕾的解剖&quot; href=&quot;#nogo&quot;&gt;Grey's Anatomy / 实习医生格蕾 / 格蕾的解剖 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Lie to Me / 千谎百计&quot; href=&quot;#nogo&quot;&gt;Lie to Me / 千谎百计 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;The Big Bang Theory / 天才理论传 / 生活大爆炸&quot; href=&quot;#nogo&quot;&gt;The Big Bang Theory / 天才理论传 / 生活大爆炸 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Growing Pains / 成长的烦恼&quot; href=&quot;#nogo&quot;&gt;Growing Pains / 成长的烦恼 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Prison Break (Season 3) / 越狱 第三季&quot; href=&quot;#nogo&quot;&gt;Prison Break (Season 3) / 越狱 第三季&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;House M.D. / 怪杰医生豪斯 / 豪斯医生&quot; href=&quot;#nogo&quot;&gt;House M.D. / 怪杰医生豪斯 / 豪斯医生 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Ugly Betty / 丑女贝蒂&quot; href=&quot;#nogo&quot;&gt;Ugly Betty / 丑女贝蒂 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Gossip Girl season2 / 八卦天后 第二季&quot; href=&quot;#nogo&quot;&gt;Gossip Girl season2 / 八卦天后 第二季&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;CSI: Crime Scene Investigation / 犯罪现场：拉斯维加斯&quot; href=&quot;#nogo&quot;&gt;CSI: Crime Scene Investigation / 犯罪现场：拉斯维加斯&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;/ul&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_FwFiNv');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_FwFiNv');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<hr />
09-05-26 补充</p>
<p>幸亏不畏强暴地贴到蓝色去挨批了，现在不用空格了，谢谢<a href="http://www.cssmagic.net/" target="_blank">birdstudio</a>的思路，要能去掉span就完美了。哦米陀佛，天上赶紧掉个</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_2GBK3H">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;表格外观的无序列表 - 原来可以不用空标签&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* { margin:0; padding:0; list-style:none;}
div { overflow:hidden; zoom:1; position:relative;}
ul { border:1px solid #cfdae8; border-left:none; border-bottom:none; overflow:hidden; background:url(http://www.14px.com/wp-content/uploads/2009/05/1.gif); zoom:1; margin-bottom:-24px; padding-top:24px;}
li { width:20%; *width:19.9%;/*IE6&amp;IE7的宽度有点点囧*/ float:left; margin-top:-24px; height:48px; position:relative;}
span { display:block; border-left:1px solid #cfdae8; height:48px; font:12px/24px tahoma; padding:0 4px;}
a { white-space:nowrap; display:block; width:100%; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; color:#000; text-decoration:none;}
a:hover { color:#f60;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Prison Break / 越狱&quot; href=&quot;#nogo&quot;&gt;Prison Break / 越狱 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Gossip Girl / 八卦天后&quot; href=&quot;#nogo&quot;&gt;Gossip Girl / 八卦天后 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Friends / 老友记 / 六人行&quot; href=&quot;#nogo&quot;&gt;Friends / 老友记 / 六人行&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Heroes / 超能英雄&quot; href=&quot;#nogo&quot;&gt;Heroes / 超能英雄&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Desperate Housewives / 绝望的主妇&quot; href=&quot;#nogo&quot;&gt;Desperate Housewives / 绝望的主妇 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Sex and the City / 欲望都市&quot; href=&quot;#nogo&quot;&gt;Sex and the City / 欲望都市 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Prison Break: Proof of Innocence / 越狱 第二季&quot; href=&quot;#nogo&quot;&gt;Prison Break: Proof of Innocence / 越狱 第二季&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Lost / 迷失&quot; href=&quot;#nogo&quot;&gt;Lost / 迷失&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Grey's Anatomy / 实习医生格蕾 / 格蕾的解剖&quot; href=&quot;#nogo&quot;&gt;Grey's Anatomy / 实习医生格蕾 / 格蕾的解剖 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Lie to Me / 千谎百计&quot; href=&quot;#nogo&quot;&gt;Lie to Me / 千谎百计 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;The Big Bang Theory / 天才理论传 / 生活大爆炸&quot; href=&quot;#nogo&quot;&gt;The Big Bang Theory / 天才理论传 / 生活大爆炸 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Growing Pains / 成长的烦恼&quot; href=&quot;#nogo&quot;&gt;Growing Pains / 成长的烦恼 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Prison Break (Season 3) / 越狱 第三季&quot; href=&quot;#nogo&quot;&gt;Prison Break (Season 3) / 越狱 第三季&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;House M.D. / 怪杰医生豪斯 / 豪斯医生&quot; href=&quot;#nogo&quot;&gt;House M.D. / 怪杰医生豪斯 / 豪斯医生 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Ugly Betty / 丑女贝蒂&quot; href=&quot;#nogo&quot;&gt;Ugly Betty / 丑女贝蒂 &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;Gossip Girl season2 / 八卦天后 第二季&quot; href=&quot;#nogo&quot;&gt;Gossip Girl season2 / 八卦天后 第二季&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span&gt;&lt;a title=&quot;CSI: Crime Scene Investigation / 犯罪现场：拉斯维加斯&quot; href=&quot;#nogo&quot;&gt;CSI: Crime Scene Investigation / 犯罪现场：拉斯维加斯&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;/ul&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;现在不用空标签了，^-^ 只是数据过少（不足一行时）没有那么多的分栏
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_2GBK3H');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_2GBK3H');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.14px.com/?feed=rss2&amp;p=164</wfw:commentRss>
		</item>
		<item>
		<title>全兼容的纯CSS级联菜单制作要点浅析</title>
		<link>http://www.14px.com/?p=148</link>
		<comments>http://www.14px.com/?p=148#comments</comments>
		<pubDate>Tue, 19 May 2009 17:39:19 +0000</pubDate>
		<dc:creator>Chomo</dc:creator>
		
		<category><![CDATA[xhtml+css]]></category>

		<category><![CDATA[:hover]]></category>

		<category><![CDATA[实例]]></category>

		<category><![CDATA[导航]]></category>

		<guid isPermaLink="false">http://www.14px.com/?p=148</guid>
		<description><![CDATA[[参与测试的浏览器：IE6 / IE7 / IE8 / FF3 / OP9.6 / SF3 / Chrome2 ]
[操作系统：Windows]
这次给云南移动网上营业厅做的级联菜单使用了纯CSS的方式，霍霍，能用CSS做的，就用CSS完成吧。^-^
早已有前辈完成过这样的实例了，我以为我能顺利完成，但没想到处处碰壁，故记录一点心得如下，供大家参阅。
废话不多说，咚咚咚，开始制作啦！！！
除了IE6这个坚强的孩子，其他浏览器攻克还是比较容易的。

&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62;
&#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&#62;
&#60;head&#62;
&#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=utf-8&#34; /&#62;
&#60;meta name=&#34;author&#34; content=&#34;Chomo&#34; /&#62;
&#60;link rel=&#34;start&#34; href=&#34;http://www.14px.com&#34; title=&#34;Home&#34; /&#62;
&#60;title&#62;三级级联菜单&#60;/title&#62;
&#60;style type=&#34;text/css&#34;&#62;
* { margin:0; padding:0; list-style:none;}
.c_subNav { width:150px; }
.c_subNav a { text-decoration:none; color:#333;}
.c_subNav a:hover { color:#f60;}
.c_subNav ul ul { position:absolute; display:none; right:-150px; top:-1px;}
.c_subNav [...]]]></description>
			<content:encoded><![CDATA[<p>[参与测试的浏览器：IE6 / IE7 / IE8 / FF3 / OP9.6 / SF3 / Chrome2 ]<br />
[操作系统：Windows]</p>
<p>这次给云南移动网上营业厅做的级联菜单使用了纯CSS的方式，霍霍，能用CSS做的，就用CSS完成吧。^-^</p>
<p>早已有前辈完成过这样的实例了，我以为我能顺利完成，但没想到处处碰壁，故记录一点心得如下，供大家参阅。</p>
<p>废话不多说，咚咚咚，开始制作啦！！！</p>
<p>除了IE6这个坚强的孩子，其他浏览器攻克还是比较容易的。</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_AYgQ1F">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;三级级联菜单&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* { margin:0; padding:0; list-style:none;}
.c_subNav { width:150px; }
.c_subNav a { text-decoration:none; color:#333;}
.c_subNav a:hover { color:#f60;}
.c_subNav ul ul { position:absolute; display:none; right:-150px; top:-1px;}
.c_subNav li { border-bottom:1px solid #ccc; position:relative; _position:static; float:left; width:100%;}
.c_subNav a.li { position:relative;}
.c_subNav li .option { display:block; line-height:15px; padding:5px 5px 5px 25px; background:no-repeat 5px 4px; cursor:pointer; font:12px Verdana; zoom:1; background:url(http://www.14px.com/wp-content/uploads/2009/05/ico.gif) no-repeat;}
.c_subNav li .option:hover { color:#f60; background-color:#ffa;}
.c_subNav li .option span { display:block; padding-right:15px; background:url(http://www.14px.com/wp-content/uploads/2009/05/ico.gif) no-repeat right 0;}
.c_subNav li .option:hover span { background-position:right -15px;}
.c_subNav .li:hover { z-index:2; background:transparent;}
.c_subNav .li:hover ul { display:block;}
.c_subNav .li:hover ul ul { display:none;}
.c_subNav .li:hover ul { border:1px solid #ccc; border-width:1px 2px 2px 1px; width:150px; background:#fff; padding:1px;}
.c_subNav .li:hover li { border-bottom:none;}
.c_subNav .li:hover li .option { padding:2px 5px; background:transparent;}
.c_subNav .li:hover li .option:hover { background:#0096ff; color:#fff;}
.c_subNav .li:hover li .option:hover span { background-position:right -30px;}
.c_subNav .li:hover .li:hover ul { display:block; left:145px; top:-2px;}
.c_subNav .charges .option { background-position:4px -45px;}
.c_subNav .biz .option { background-position:4px -70px;}
.c_subNav .change .option { background-position:4px -95px;}
.c_subNav .score .option { background-position:4px -120px;}
.c_subNav .server .option { background-position:4px -145px;}
.c_subNav .edit .option { background-position:4px -170px;}
.c_subNav .sms .option { background-position:4px -195px;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;c_subNav&quot;&gt;
	&lt;ul&gt;
		&lt;li class=&quot;li charges&quot;&gt;
			&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;话费服务&lt;/span&gt;&lt;/a&gt;
			&lt;ul&gt;
				&lt;li class=&quot;li&quot;&gt;
					&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;话费查询&lt;/span&gt;&lt;/a&gt;
					&lt;ul&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;实时话费查询&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;话费余额查询&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;月账单查询&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;月详单查询&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;缴费历史查询&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;资费优选推荐&lt;/a&gt;&lt;/li&gt;
					&lt;/ul&gt;
				&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;
					&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;定制话费信息&lt;/span&gt;&lt;/a&gt;
					&lt;ul&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;定制短信账单&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;话费余额短信提醒&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;定制Email账单&lt;/a&gt;&lt;/li&gt;
					&lt;/ul&gt;
				&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;
					&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;网上交费&lt;/span&gt;&lt;/a&gt;
					&lt;ul&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;网上缴费&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;充值卡缴费&lt;/a&gt;&lt;/li&gt;
					&lt;/ul&gt;
				&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li class=&quot;li biz&quot;&gt;
			&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;业务办理&lt;/span&gt;&lt;/a&gt;
			&lt;ul&gt;
				&lt;li class=&quot;li&quot;&gt;
					&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;日常业务办理&lt;/span&gt;&lt;/a&gt;
					&lt;ul&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;来电显示&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;呼叫等待&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;呼叫转移&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;三方通话&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;来电提醒&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;呼叫保持&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;呼叫转移设置&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;主叫隐藏&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;彩铃&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;国内漫游&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;短信回执&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;12580综合信息&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;关爱一线通&lt;/a&gt;&lt;/li&gt;
					&lt;/ul&gt;
				&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;
					&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;数据业务&lt;/span&gt;&lt;/a&gt;
					&lt;ul&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;手机上网&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;GPRS&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;飞信&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;手机报&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;无线音乐俱乐部&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;手机邮箱&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;号簿管家&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;WLAN业务&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;彩乐短信&lt;/a&gt;&lt;/li&gt;
					&lt;/ul&gt;
				&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;
					&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;手机报停/报开&lt;/span&gt;&lt;/a&gt;
					&lt;ul&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;手机报停&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;手机复机&lt;/a&gt;&lt;/li&gt;
					&lt;/ul&gt;
				&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;
					&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;梦网查询与退订&lt;/a&gt;
				&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li class=&quot;li change&quot;&gt;
			&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;套餐办理与变更&lt;/span&gt;&lt;/a&gt;
			&lt;ul&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;GPRS套餐变更&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;产品变更&lt;/a&gt;&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li class=&quot;li score&quot;&gt;
			&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;积分计划&lt;/span&gt;&lt;/a&gt;
			&lt;ul&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;积分查询&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;积分兑换&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;积分明细查询&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;积分兑换话费&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;积分兑换历史查询&lt;/a&gt;&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li class=&quot;li server&quot;&gt;
			&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;在线客服&lt;/span&gt;&lt;/a&gt;
			&lt;ul&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;号码归属地查询&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;营业厅查询&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;手机仿真&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;在线咨询&lt;/a&gt;&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li class=&quot;li edit&quot;&gt;
			&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;个人信息管理&lt;/span&gt;&lt;/a&gt;
			&lt;ul&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;个人资料修改&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;服务密码变更&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;服务密码重置&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;PUK码查询&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;套餐使用状态查询&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;业务开通状态查询&lt;/a&gt;&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li class=&quot;li sms&quot;&gt;
			&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;短信息服务&lt;/a&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_AYgQ1F');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_AYgQ1F');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>该实例完成大概就两个要点：</p>
<p>1. 忌浮忌躁，一步步来，先把最低级的display:none;掉。</p>
<p>2. “:hover伪类”的使用，默认状态“display:none;”，“:hover”时则“display:block;”则能很容易完成。</p>
<p>而IE6下折腾就比较复杂了，经过头破血流的教训之后，总结出关键四点：</p>
<p><strong>1. 原理：</strong>IE6仅<code>&lt;a&gt;</code>标签支持:hover伪类，但如果a标签里面再嵌入a标签，里面的a标签将不会生效，所以必须在之间套加一层<code>&lt;table&gt;</code>；</p>
<div class="hl-surround">
<ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)">
<li class="hl-firstline">&lt;!&#8211;[if IE 6]&gt;&lt;a href=&quot;#nogo&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;![endif]&#8211;&gt;</li>
<li>	内容部分可以含有&lt;a&gt;标签</li>
<li>&lt;!&#8211;[if IE 6]&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/a&gt;&lt;![endif]&#8211;&gt;</li>
</ol>
</div>
<p><strong>2. 关键样式名：</strong>这个用于:hover效果的a标签的命名，如果使用与<code>&lt;li&gt;</code>一致的样式名（在非IE6中是li:hover产生的效果），将不用再另写样式代码，不仅节省了代码开销，而且可维性更好；</p>
<div class="hl-surround">
<ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)">
<li class="hl-firstline">&lt;li class=&quot;li&quot;&gt;</li>
<li>	&lt;!&#8211;[if IE 6]&gt;&lt;a class=&quot;li&quot; href=&quot;#nogo&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;![endif]&#8211;&gt;</li>
<li>		内容部分可以含有&lt;a&gt;标签</li>
<li>	&lt;!&#8211;[if IE 6]&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/a&gt;&lt;![endif]&#8211;&gt;</li>
<li>&lt;/li&gt;</li>
</ol>
</div>
<p><strong>3. visibility的使用：</strong>采用display的话将出现onmouseout时上一次显示的optionGroup仍然不消失的情况</p>
<div class="hl-surround">
<ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)">
<li class="hl-firstline">.c_subNav .li:hover ul { visibility:visible;}</li>
</ol>
</div>
<p><strong>4.table的设置：</strong>[含泪ing]table一定要记得width:100%;啊，一定要记得啊，一定要记得啊，一定要记得啊……</p>
<p>最后完成效果：</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_98H2aw">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
&lt;title&gt;三级级联菜单&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
* { margin:0; padding:0; list-style:none;}
.c_subNav { width:150px; }
.c_subNav table { width:100%; border-collapse:collapse;}
.c_subNav a { text-decoration:none; color:#333;}
.c_subNav a:hover { color:#f60;}
.c_subNav ul ul { position:absolute; visibility:hidden; right:-150px; top:-1px;}
.c_subNav li { border-bottom:1px solid #ccc; position:relative; _position:static; float:left; width:100%;}
.c_subNav a.li { position:relative;}
.c_subNav li .option { display:block; line-height:15px; padding:5px 5px 5px 25px; background:no-repeat 5px 4px; cursor:pointer; font:12px Verdana; zoom:1; background:url(http://www.14px.com/wp-content/uploads/2009/05/ico.gif) no-repeat;}
.c_subNav li .option:hover { color:#f60; background-color:#ffa;}
.c_subNav li .option span { display:block; padding-right:15px; background:url(http://www.14px.com/wp-content/uploads/2009/05/ico.gif) no-repeat right 0;}
.c_subNav li .option:hover span { background-position:right -15px;}
.c_subNav .li:hover { z-index:2; background:transparent;}
.c_subNav .li:hover ul { visibility:visible;}
.c_subNav .li:hover ul ul { visibility:hidden;}
.c_subNav .li:hover ul { border:1px solid #ccc; border-width:1px 2px 2px 1px; width:150px; background:#fff; padding:1px;}
.c_subNav .li:hover li { border-bottom:none;}
.c_subNav .li:hover li .option { padding:2px 5px; background:transparent;}
.c_subNav .li:hover li .option:hover { background:#0096ff; color:#fff;}
.c_subNav .li:hover li .option:hover span { background-position:right -30px;}
.c_subNav .li:hover .li:hover ul { visibility:visible; left:145px; top:-2px;}
/*---图标差异---*/
.c_subNav .charges .option { background-position:4px -45px;}
.c_subNav .biz .option { background-position:4px -70px;}
.c_subNav .change .option { background-position:4px -95px;}
.c_subNav .score .option { background-position:4px -120px;}
.c_subNav .server .option { background-position:4px -145px;}
.c_subNav .edit .option { background-position:4px -170px;}
.c_subNav .sms .option { background-position:4px -195px;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;c_subNav&quot;&gt;
	&lt;ul&gt;
		&lt;li class=&quot;li charges&quot;&gt;
			&lt;!--[if IE 6]&gt;&lt;a class=&quot;li&quot; href=&quot;#nogo&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;![endif]--&gt;
			&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;话费服务&lt;/span&gt;&lt;/a&gt;
			&lt;ul&gt;
				&lt;li class=&quot;li&quot;&gt;
					&lt;!--[if IE 6]&gt;&lt;a class=&quot;li&quot; href=&quot;#nogo&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;![endif]--&gt;
					&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;话费查询&lt;/span&gt;&lt;/a&gt;
					&lt;ul&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;实时话费查询&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;话费余额查询&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;月账单查询&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;月详单查询&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;缴费历史查询&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;资费优选推荐&lt;/a&gt;&lt;/li&gt;
					&lt;/ul&gt;
					&lt;!--[if IE 6]&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/a&gt;&lt;![endif]--&gt;
				&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;
					&lt;!--[if IE 6]&gt;&lt;a class=&quot;li&quot; href=&quot;#nogo&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;![endif]--&gt;
					&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;定制话费信息&lt;/span&gt;&lt;/a&gt;
					&lt;ul&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;定制短信账单&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;话费余额短信提醒&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;定制Email账单&lt;/a&gt;&lt;/li&gt;
					&lt;/ul&gt;
					&lt;!--[if IE 6]&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/a&gt;&lt;![endif]--&gt;
				&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;
					&lt;!--[if IE 6]&gt;&lt;a class=&quot;li&quot; href=&quot;#nogo&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;![endif]--&gt;
					&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;网上交费&lt;/span&gt;&lt;/a&gt;
					&lt;ul&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;网上缴费&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;充值卡缴费&lt;/a&gt;&lt;/li&gt;
					&lt;/ul&gt;
					&lt;!--[if IE 6]&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/a&gt;&lt;![endif]--&gt;
				&lt;/li&gt;
			&lt;/ul&gt;
			&lt;!--[if IE 6]&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/a&gt;&lt;![endif]--&gt;
		&lt;/li&gt;
		&lt;li class=&quot;li biz&quot;&gt;
			&lt;!--[if IE 6]&gt;&lt;a class=&quot;li&quot; href=&quot;#nogo&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;![endif]--&gt;
			&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;业务办理&lt;/span&gt;&lt;/a&gt;
			&lt;ul&gt;
				&lt;li class=&quot;li&quot;&gt;
					&lt;!--[if IE 6]&gt;&lt;a class=&quot;li&quot; href=&quot;#nogo&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;![endif]--&gt;
					&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;日常业务办理&lt;/span&gt;&lt;/a&gt;
					&lt;ul&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;来电显示&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;呼叫等待&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;呼叫转移&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;三方通话&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;来电提醒&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;呼叫保持&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;呼叫转移设置&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;主叫隐藏&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;彩铃&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;国内漫游&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;短信回执&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;12580综合信息&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;关爱一线通&lt;/a&gt;&lt;/li&gt;
					&lt;/ul&gt;
					&lt;!--[if IE 6]&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/a&gt;&lt;![endif]--&gt;
				&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;
					&lt;!--[if IE 6]&gt;&lt;a class=&quot;li&quot; href=&quot;#nogo&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;![endif]--&gt;
					&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;数据业务&lt;/span&gt;&lt;/a&gt;
					&lt;ul&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;手机上网&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;GPRS&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;飞信&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;手机报&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;无线音乐俱乐部&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;手机邮箱&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;号簿管家&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;WLAN业务&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;彩乐短信&lt;/a&gt;&lt;/li&gt;
					&lt;/ul&gt;
					&lt;!--[if IE 6]&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/a&gt;&lt;![endif]--&gt;
				&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;
					&lt;!--[if IE 6]&gt;&lt;a class=&quot;li&quot; href=&quot;#nogo&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;![endif]--&gt;
					&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;手机报停/报开&lt;/span&gt;&lt;/a&gt;
					&lt;ul&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;手机报停&lt;/a&gt;&lt;/li&gt;
						&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;手机复机&lt;/a&gt;&lt;/li&gt;
					&lt;/ul&gt;
					&lt;!--[if IE 6]&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/a&gt;&lt;![endif]--&gt;
				&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;
					&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;梦网查询与退订&lt;/a&gt;
				&lt;/li&gt;
			&lt;/ul&gt;
			&lt;!--[if IE 6]&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/a&gt;&lt;![endif]--&gt;
		&lt;/li&gt;
		&lt;li class=&quot;li change&quot;&gt;
			&lt;!--[if IE 6]&gt;&lt;a class=&quot;li&quot; href=&quot;#nogo&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;![endif]--&gt;
			&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;套餐办理与变更&lt;/span&gt;&lt;/a&gt;
			&lt;ul&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;GPRS套餐变更&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;产品变更&lt;/a&gt;&lt;/li&gt;
			&lt;/ul&gt;
			&lt;!--[if IE 6]&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/a&gt;&lt;![endif]--&gt;
		&lt;/li&gt;
		&lt;li class=&quot;li score&quot;&gt;
			&lt;!--[if IE 6]&gt;&lt;a class=&quot;li&quot; href=&quot;#nogo&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;![endif]--&gt;
			&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;积分计划&lt;/span&gt;&lt;/a&gt;
			&lt;ul&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;积分查询&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;积分兑换&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;积分明细查询&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;积分兑换话费&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;积分兑换历史查询&lt;/a&gt;&lt;/li&gt;
			&lt;/ul&gt;
			&lt;!--[if IE 6]&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/a&gt;&lt;![endif]--&gt;
		&lt;/li&gt;
		&lt;li class=&quot;li server&quot;&gt;
			&lt;!--[if IE 6]&gt;&lt;a class=&quot;li&quot; href=&quot;#nogo&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;![endif]--&gt;
			&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;在线客服&lt;/span&gt;&lt;/a&gt;
			&lt;ul&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;号码归属地查询&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;营业厅查询&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;手机仿真&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;在线咨询&lt;/a&gt;&lt;/li&gt;
			&lt;/ul&gt;
			&lt;!--[if IE 6]&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/a&gt;&lt;![endif]--&gt;
		&lt;/li&gt;
		&lt;li class=&quot;li edit&quot;&gt;
			&lt;!--[if IE 6]&gt;&lt;a class=&quot;li&quot; href=&quot;#nogo&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;![endif]--&gt;
			&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;&lt;span&gt;个人信息管理&lt;/span&gt;&lt;/a&gt;
			&lt;ul&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;个人资料修改&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;服务密码变更&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;服务密码重置&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;PUK码查询&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;套餐使用状态查询&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;li&quot;&gt;&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;业务开通状态查询&lt;/a&gt;&lt;/li&gt;
			&lt;/ul&gt;
			&lt;!--[if IE 6]&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/a&gt;&lt;![endif]--&gt;
		&lt;/li&gt;
		&lt;li class=&quot;li sms&quot;&gt;
			&lt;a href=&quot;#nogo&quot; class=&quot;option&quot;&gt;短信息服务&lt;/a&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_98H2aw');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_98H2aw');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.14px.com/?feed=rss2&amp;p=148</wfw:commentRss>
		</item>
		<item>
		<title>对主流浏览器“半个像素”渲染差异分析</title>
		<link>http://www.14px.com/?p=135</link>
		<comments>http://www.14px.com/?p=135#comments</comments>
		<pubDate>Sun, 10 May 2009 17:36:00 +0000</pubDate>
		<dc:creator>Chomo</dc:creator>
		
		<category><![CDATA[xhtml+css]]></category>

		<category><![CDATA[hack]]></category>

		<guid isPermaLink="false">http://www.14px.com/?p=135</guid>
		<description><![CDATA[[参与测试的浏览器：IE6 / IE7 / IE8 / FF3 / OP9.6 / SF3 / Chrome2 ]
[操作系统：Windows]
像素都是单个单个显示的，绝对不会出现半个像素，那么0.63px这样的定义经各浏览器渲染之后得出什么样的结果呢？
经过偶不厌其烦的例举分析，得到以下结果并经过了一次验算，第二次验算在实战中用到它再说吧。
这个结果能用到什么场合呢？恩，我也不知道。囧rz。
但我相信既然有差异肯定就能起到hack的作用。可不要小看一个半个的像素，有时候它能起到很关键的作用，这个差异最大的特点就是几乎每个浏览器之间，均存在该差异。
一点说明：一般精确到1/1000就能看出各浏览器之间的差异，这里采用直接进一法来精确到1/1000。

border
IE6/IE7 &#124; 1.000 = 1
OP9.6　 &#124; 0.995 = 1
Chrome2 &#124; 0.990 = 1
SF3　　 &#124; 0.98999998 = 1
IE8　　 &#124; 0.010 = 1
FF3　　 &#124; 0.009 = 1
width
IE6/IE7 &#124; 1.000 = 1
OP9.6　 &#124; 0.995 = 1
SF3　　 &#124; 0.991 = 1
Chrome2 &#124; 0.990 = 1
IE8　　 &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>[参与测试的浏览器：IE6 / IE7 / IE8 / FF3 / OP9.6 / SF3 / Chrome2 ]<br />
[操作系统：Windows]</p>
<p>像素都是单个单个显示的，绝对不会出现半个像素，那么0.63px这样的定义经各浏览器渲染之后得出什么样的结果呢？<br />
经过偶不厌其烦的例举分析，得到以下结果并经过了一次验算，第二次验算在实战中用到它再说吧。</p>
<p>这个结果能用到什么场合呢？恩，我也不知道。囧rz。<br />
但我相信既然有差异肯定就能起到hack的作用。可不要小看一个半个的像素，有时候它能起到很关键的作用，这个差异最大的特点就是<strong>几乎每个浏览器之间，均存在该差异</strong>。</p>
<p><strong>一点说明：</strong>一般精确到1/1000就能看出各浏览器之间的差异，这里采用直接<a target="_blank" href="http://baike.baidu.com/view/1335073.htm">进一法</a>来精确到1/1000。</p>
<blockquote style="font-family:simsun;"><p>
<strong>border</strong></p>
<p>IE6/IE7 | 1.000 = 1<br />
OP9.6　 | 0.995 = 1<br />
Chrome2 | 0.990 = 1<br />
SF3　　 | 0.98999998 = 1<br />
IE8　　 | 0.010 = 1<br />
FF3　　 | 0.009 = 1</p>
<p><strong>width</strong></p>
<p>IE6/IE7 | 1.000 = 1<br />
OP9.6　 | 0.995 = 1<br />
SF3　　 | 0.991 = 1<br />
Chrome2 | 0.990 = 1<br />
IE8　　 | 0.510 = 1<br />
FF3　　 | 0.492 = 1</p>
<p><strong>margin负值</strong></p>
<p>IE6/IE7 | 1.000 = 1<br />
OP9.6　 | 0.995 = 1<br />
Chrome2 | 0.990 = 1<br />
SF3　　 | 0.98999998 = 1<br />
FF3　　 | 0.509 = 1<br />
IE8　　 | 0.500 = 1</p>
<p><strong>margin正值</strong></p>
<p>IE6/IE7 | 1.000 = 1<br />
OP9.6　 | 0.995 = 1<br />
Chrome2 | 0.990 = 1<br />
SF3　　 | 0.98999998 = 1<br />
IE8　　 | 0.510 = 1<br />
FF3　　 | 0.492 = 1</p>
<p><strong>padding</strong></p>
<p>IE6/IE7 | 1.000 = 1<br />
OP9.6　 | 0.995 = 1<br />
Chrome2 | 0.990 = 1<br />
SF3　　 | 0.98999998 = 1<br />
IE8　　 | 0.510 = 1<br />
FF3　　 | 0.492 = 1
</p></blockquote>
<p>其中有几种比较特殊的情况：</p>
<p>[IE8/border：如果border-left与border-right同时存在，border-width:0.010时对width宽度造成影响，小于既定宽度2px，0.510时小1px，0.760时恢复正常。]</p>
<p>[IE8/padding：如果padding-left与padding-right同时存在，padding:0.260时出现right &amp; bottom边框，0.510时出现top和bottom边框，0.760时才两者同时出现。]</p>
<p>[FF3/padding：如果padding-left与padding-right同时存在，padding:0.242时出现right &amp; bottom边框，0.492时出现top和bottom边框，0.742时才两者同时出现。]</p>
<p>【几个属性同时使用时的情况太复杂了，FF简直寻不着规律，IE8还好点，以下举个例子，就不继续深入探讨了】</p>
<p>以IE8为例，padding和margin同时使用小数时：<br />
设padding-left:0.510;（单独使用padding-left时，IE8下，0.510=1） margin-left:1px;为正常状态。<br />
margin-left则不能使用小数，否则小数部分无效。<br />
如果padding-left:0.520，margin-left则可使用49.99px。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.14px.com/?feed=rss2&amp;p=135</wfw:commentRss>
		</item>
		<item>
		<title>解决IE6与IE7中的按钮多出1px的内边框问题</title>
		<link>http://www.14px.com/?p=130</link>
		<comments>http://www.14px.com/?p=130#comments</comments>
		<pubDate>Sat, 09 May 2009 15:18:07 +0000</pubDate>
		<dc:creator>Chomo</dc:creator>
		
		<category><![CDATA[xhtml+css]]></category>

		<category><![CDATA[bug]]></category>

		<category><![CDATA[IE6/IE7]]></category>

		<category><![CDATA[按钮]]></category>

		<category><![CDATA[表单元素]]></category>

		<guid isPermaLink="false">http://www.14px.com/?p=130</guid>
		<description><![CDATA[[参与测试的浏览器：IE6 / IE7 / IE8 / FF3 / OP9.6 / SF3 / Chrome2 ]
[操作系统：Windows]
自古多情空余恨——这话太适合形容我此时此刻的心情，IE6/IE7这俩自作多情的浏览器经常让我愤恨不已。
这故事、这bug是这样的：
默认的按钮我不爱它，所以我想给它一个我觉得漂亮的背景，但是长度又不一致，所以就加个border，然后弄个可以repeat-x的background-image。
结果：IE6/IE7出现了1px的白色内边框。

&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62;
&#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&#62;
	&#60;head&#62;
		&#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=utf-8&#34; /&#62;
		&#60;meta name=&#34;author&#34; content=&#34;Chomo&#34; /&#62;
		&#60;link rel=&#34;start&#34; href=&#34;http://www.14px.com&#34; title=&#34;Home&#34; /&#62;
		&#60;title&#62;IE6/IE7下按钮多了1px白色内边框&#60;/title&#62;
		&#60;style type=&#34;text/css&#34;&#62;
			* { margin:0; padding:0; list-style:none;}
			body { background:#fff;}
			button { height:59px; font-size:30px; font-family:Vernada; padding:0 30px; color:#fff; overflow:visible; border:1px solid #000; background:url(http://www.14px.com/wp-content/uploads/2009/05/buttonbg.gif);}
		&#60;/style&#62;
	&#60;/head&#62;
	&#60;body&#62;
		&#60;button&#62;IE6/IE7下，它多了1px白色内边框 T_T&#60;/button&#62;
	&#60;/body&#62;
&#60;/html&#62;
  提示：你可以先修改部分代码再运行。

^-^ [...]]]></description>
			<content:encoded><![CDATA[<p>[参与测试的浏览器：IE6 / IE7 / IE8 / FF3 / OP9.6 / SF3 / Chrome2 ]<br />
[操作系统：Windows]</p>
<p>自古多情空余恨——这话太适合形容我此时此刻的心情，IE6/IE7这俩自作多情的浏览器经常让我愤恨不已。<br />
这故事、这bug是这样的：</p>
<p>默认的按钮我不爱它，所以我想给它一个我觉得漂亮的背景，但是长度又不一致，所以就加个border，然后弄个可以repeat-x的background-image。<br />
结果：IE6/IE7出现了1px的白色内边框。</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_YvSMWo">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
	&lt;head&gt;
		&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
		&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
		&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
		&lt;title&gt;IE6/IE7下按钮多了1px白色内边框&lt;/title&gt;
		&lt;style type=&quot;text/css&quot;&gt;
			* { margin:0; padding:0; list-style:none;}
			body { background:#fff;}
			button { height:59px; font-size:30px; font-family:Vernada; padding:0 30px; color:#fff; overflow:visible; border:1px solid #000; background:url(http://www.14px.com/wp-content/uploads/2009/05/buttonbg.gif);}
		&lt;/style&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;button&gt;IE6/IE7下，它多了1px白色内边框 T_T&lt;/button&gt;
	&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_YvSMWo');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_YvSMWo');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>^-^ 改变了一下body的背景，发现原来这个内边框其实不是白色的，而是透明的。</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_EkgsEw">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
	&lt;head&gt;
		&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
		&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
		&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
		&lt;title&gt;IE6/IE7下按钮多了1px白色内边框&lt;/title&gt;
		&lt;style type=&quot;text/css&quot;&gt;
			* { margin:0; padding:0; list-style:none;}
			body { background:#0c0;}
			button { height:59px; font-size:30px; font-family:Vernada; padding:0 30px; color:#fff; overflow:visible; border:1px solid #000; background:url(http://www.14px.com/wp-content/uploads/2009/05/buttonbg.gif);}
		&lt;/style&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;button&gt;原来这个内边框是透明&lt;/button&gt;
	&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_EkgsEw');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_EkgsEw');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>唔，幸亏是透明的，于是解决方案很快就找到啦：</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_BRBlLV">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
	&lt;head&gt;
		&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
		&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
		&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
		&lt;title&gt;没border就好了 ^-^&lt;/title&gt;
		&lt;style type=&quot;text/css&quot;&gt;
			* { margin:0; padding:0; list-style:none;}
			body { background:#0c0;}
			span { border:1px solid #000; display:inline-block; height:59px; line-height:59px;}
			button { height:59px; border:none; font-size:30px; font-family:Vernada; padding:0 30px; color:#fff; overflow:visible; background:url(http://www.14px.com/wp-content/uploads/2009/05/buttonbg.gif);}
		&lt;/style&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;span&gt;&lt;button&gt;没border就好了 ^-^&lt;/button&gt;&lt;/span&gt;
	&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_BRBlLV');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_BRBlLV');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.14px.com/?feed=rss2&amp;p=130</wfw:commentRss>
		</item>
		<item>
		<title>float-left的对象如何居中</title>
		<link>http://www.14px.com/?p=125</link>
		<comments>http://www.14px.com/?p=125#comments</comments>
		<pubDate>Sat, 09 May 2009 14:35:28 +0000</pubDate>
		<dc:creator>Chomo</dc:creator>
		
		<category><![CDATA[xhtml+css]]></category>

		<category><![CDATA[float]]></category>

		<category><![CDATA[inline-block]]></category>

		<category><![CDATA[居中]]></category>

		<guid isPermaLink="false">http://www.14px.com/?p=125</guid>
		<description><![CDATA[[参与测试的浏览器：IE6 / IE7 / IE8 / FF3 / OP9.6 / SF3 / Chrome2 ]
[操作系统：Windows]
[float:left]有个伟大之处，它使div（或者其他标签）的宽度自适应其内容，但它却有个弊端：无法居中。
[display:inline-block]也有同样的特性，并且可以居中，但连续几个这样的东东，之间却会出现空格。
为了解决这个问题，我们可以把二者结合起来使用：

&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62;
&#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&#62;
	&#60;head&#62;
		&#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=utf-8&#34; /&#62;
		&#60;meta name=&#34;author&#34; content=&#34;Chomo&#34; /&#62;
		&#60;link rel=&#34;start&#34; href=&#34;http://www.14px.com&#34; title=&#34;Home&#34; /&#62;
		&#60;title&#62;inline-block解决float:left对象无法居中的问题。&#60;/title&#62;
		&#60;style type=&#34;text/css&#34;&#62;
			* { margin:0; padding:0; list-style:none;}
			body { text-align:center;}
			li { float:left; font-size:12px;}
			a { float:left; border:1px solid #000; padding:5px 10px; text-decoration:none; color:#000;}
			span { display:inline-block;}
		&#60;/style&#62;
	&#60;/head&#62;
	&#60;body&#62;
		&#60;span&#62;
			&#60;ul&#62;
				&#60;li&#62;&#60;a href=&#34;#nogo&#34;&#62;首页&#60;/a&#62;&#60;/li&#62;
				&#60;li&#62;&#60;a [...]]]></description>
			<content:encoded><![CDATA[<p>[参与测试的浏览器：IE6 / IE7 / IE8 / FF3 / OP9.6 / SF3 / Chrome2 ]<br />
[操作系统：Windows]</p>
<p>[float:left]有个伟大之处，它使div（或者其他标签）的宽度自适应其内容，但它却有个弊端：无法居中。<br />
[display:inline-block]也有同样的特性，并且可以居中，但连续几个这样的东东，之间却会出现空格。</p>
<p>为了解决这个问题，我们可以把二者结合起来使用：</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_lcj7cz">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
	&lt;head&gt;
		&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
		&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
		&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
		&lt;title&gt;inline-block解决float:left对象无法居中的问题。&lt;/title&gt;
		&lt;style type=&quot;text/css&quot;&gt;
			* { margin:0; padding:0; list-style:none;}
			body { text-align:center;}
			li { float:left; font-size:12px;}
			a { float:left; border:1px solid #000; padding:5px 10px; text-decoration:none; color:#000;}
			span { display:inline-block;}
		&lt;/style&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;span&gt;
			&lt;ul&gt;
				&lt;li&gt;&lt;a href=&quot;#nogo&quot;&gt;首页&lt;/a&gt;&lt;/li&gt;
				&lt;li&gt;&lt;a href=&quot;#nogo&quot;&gt;关于&lt;/a&gt;&lt;/li&gt;
				&lt;li&gt;&lt;a href=&quot;#nogo&quot;&gt;产品&lt;/a&gt;&lt;/li&gt;
				&lt;li&gt;&lt;a href=&quot;#nogo&quot;&gt;联系我们&lt;/a&gt;&lt;/li&gt;
				&lt;li&gt;&lt;a href=&quot;#nogo&quot;&gt;留言&lt;/a&gt;&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/span&gt;
	&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_lcj7cz');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_lcj7cz');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>当然，这样的结构是不正确的，但是我们可以模拟一下（模拟方法的详情请见<a href="http://www.planabc.net/" target="_blank">怿飞</a>的文章：<a href="http://www.planabc.net/2008/04/08/cross_browser_support_for_inline-block_styling/" target="_blank">模拟兼容性的 inline-block 属性</a>）</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_EOkZjU">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
	&lt;head&gt;
		&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
		&lt;meta name=&quot;author&quot; content=&quot;Chomo&quot; /&gt;
		&lt;link rel=&quot;start&quot; href=&quot;http://www.14px.com&quot; title=&quot;Home&quot; /&gt;
		&lt;title&gt;inline-block解决float:left对象无法居中的问题。&lt;/title&gt;
		&lt;style type=&quot;text/css&quot;&gt;
			* { margin:0; padding:0; list-style:none;}
			body { text-align:center;}
			li { float:left; font-size:12px;}
			a { float:left; border:1px solid #000; padding:5px 10px; text-decoration:none; color:#000;}
			ul { display:inline-block; *display:inline; zoom:1;}
		&lt;/style&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;ul&gt;
			&lt;li&gt;&lt;a href=&quot;#nogo&quot;&gt;首页&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#nogo&quot;&gt;关于&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#nogo&quot;&gt;产品&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#nogo&quot;&gt;联系我们&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#nogo&quot;&gt;留言&lt;/a&gt;&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/body&gt;
&lt;/html&gt;</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_EOkZjU');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_EOkZjU');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.14px.com/?feed=rss2&amp;p=125</wfw:commentRss>
		</item>
		<item>
		<title>使用createEvent来实现联动下拉</title>
		<link>http://www.14px.com/?p=119</link>
		<comments>http://www.14px.com/?p=119#comments</comments>
		<pubDate>Wed, 06 May 2009 17:40:26 +0000</pubDate>
		<dc:creator>shieh</dc:creator>
		
		<category><![CDATA[js+ajax]]></category>

		<guid isPermaLink="false">http://www.14px.com/?p=119</guid>
		<description><![CDATA[联动下拉是一个很多地方都要用到的实用功能，使用createEvent创建并调用下拉框的onchange事件可以减少代码的冗余度，并且在多个下拉框数据同步刷新时使用比较简单清晰的代码结构实现多层事件联动。
示例代码：


&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62;
&#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&#62;
&#60;head&#62;
&#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=gbk&#34; /&#62;
&#60;title&#62;无标题文档&#60;/title&#62;
&#60;script language=&#34;javascript&#34;&#62;
&#60;!--
var gecko=navigator.userAgent.toLowerCase().indexOf('gecko')&#62;0;
function fireEvent(obj,event){
	if(gecko){
		var e = document.createEvent('HTMLEvents');
		e.initEvent(event,true,true);
		obj.dispatchEvent(e);
		e.stopPropagation();
		e.preventDefault();
		e=null;
	}else{
		eval(&#34;if(typeof(obj.on&#34; + event + &#34;=='function'))obj.on&#34; + event + &#34;.call(obj);&#34;);
	}
}
function change1(sel){
	var sel2=document.getElementById('SEL_2');
	sel2.options[sel.selectedIndex].selected=true;
	fireEvent(sel2,&#34;change&#34;);
}
function change2(sel){
	var sel3=document.getElementById('SEL_3');
	sel3.options[sel.selectedIndex].selected=true;
	fireEvent(sel3,&#34;change&#34;);
}
function change3(sel){
	var sel4=document.getElementById('SEL_4');
	sel4.options[sel.selectedIndex].selected=true;
}
//--&#62;
&#60;/script&#62;
&#60;/head&#62;
&#60;body&#62;
&#60;SELECT id=&#34;SEL_1&#34; onchange=&#34;change1(this);&#34;&#62;
&#60;option value=&#34;0&#34;&#62;A1&#60;/option&#62;
&#60;option value=&#34;1&#34;&#62;A2&#60;/option&#62;
&#60;option value=&#34;2&#34;&#62;A3&#60;/option&#62;
&#60;/SELECT&#62;
&#60;SELECT id=&#34;SEL_2&#34; onchange=&#34;change2(this);&#34;&#62;
&#60;option value=&#34;0&#34;&#62;B1&#60;/option&#62;
&#60;option value=&#34;1&#34;&#62;B2&#60;/option&#62;
&#60;option value=&#34;2&#34;&#62;B3&#60;/option&#62;
&#60;/SELECT&#62;
&#60;SELECT id=&#34;SEL_3&#34; onchange=&#34;change3(this);&#34;&#62;
&#60;option value=&#34;0&#34;&#62;C1&#60;/option&#62;
&#60;option value=&#34;1&#34;&#62;C2&#60;/option&#62;
&#60;option value=&#34;2&#34;&#62;C3&#60;/option&#62;
&#60;/SELECT&#62;
&#60;SELECT id=&#34;SEL_4&#34;&#62;
&#60;option value=&#34;0&#34;&#62;D1&#60;/option&#62;
&#60;option value=&#34;1&#34;&#62;D2&#60;/option&#62;
&#60;option value=&#34;2&#34;&#62;D3&#60;/option&#62;
&#60;/SELECT&#62;
&#60;/body&#62;
&#60;/html&#62;

  提示：你可以先修改部分代码再运行。

在这个例子中，后两个下拉选择框的值都会根据前一个下拉选择框值的改变而改变，可以使用类似的办法实现更复杂的功能，比如使用ajax来异步填充数据等
]]></description>
			<content:encoded><![CDATA[<p>联动下拉是一个很多地方都要用到的实用功能，使用createEvent创建并调用下拉框的onchange事件可以减少代码的冗余度，并且在多个下拉框数据同步刷新时使用比较简单清晰的代码结构实现多层事件联动。</p>
<p>示例代码：</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_D5YECE">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gbk&quot; /&gt;
&lt;title&gt;无标题文档&lt;/title&gt;
&lt;script language=&quot;javascript&quot;&gt;
&lt;!--
var gecko=navigator.userAgent.toLowerCase().indexOf('gecko')&gt;0;
function fireEvent(obj,event){
	if(gecko){
		var e = document.createEvent('HTMLEvents');
		e.initEvent(event,true,true);
		obj.dispatchEvent(e);
		e.stopPropagation();
		e.preventDefault();
		e=null;
	}else{
		eval(&quot;if(typeof(obj.on&quot; + event + &quot;=='function'))obj.on&quot; + event + &quot;.call(obj);&quot;);
	}
}
function change1(sel){
	var sel2=document.getElementById('SEL_2');
	sel2.options[sel.selectedIndex].selected=true;
	fireEvent(sel2,&quot;change&quot;);
}
function change2(sel){
	var sel3=document.getElementById('SEL_3');
	sel3.options[sel.selectedIndex].selected=true;
	fireEvent(sel3,&quot;change&quot;);
}
function change3(sel){
	var sel4=document.getElementById('SEL_4');
	sel4.options[sel.selectedIndex].selected=true;
}
//--&gt;
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;SELECT id=&quot;SEL_1&quot; onchange=&quot;change1(this);&quot;&gt;
&lt;option value=&quot;0&quot;&gt;A1&lt;/option&gt;
&lt;option value=&quot;1&quot;&gt;A2&lt;/option&gt;
&lt;option value=&quot;2&quot;&gt;A3&lt;/option&gt;
&lt;/SELECT&gt;
&lt;SELECT id=&quot;SEL_2&quot; onchange=&quot;change2(this);&quot;&gt;
&lt;option value=&quot;0&quot;&gt;B1&lt;/option&gt;
&lt;option value=&quot;1&quot;&gt;B2&lt;/option&gt;
&lt;option value=&quot;2&quot;&gt;B3&lt;/option&gt;
&lt;/SELECT&gt;
&lt;SELECT id=&quot;SEL_3&quot; onchange=&quot;change3(this);&quot;&gt;
&lt;option value=&quot;0&quot;&gt;C1&lt;/option&gt;
&lt;option value=&quot;1&quot;&gt;C2&lt;/option&gt;
&lt;option value=&quot;2&quot;&gt;C3&lt;/option&gt;
&lt;/SELECT&gt;
&lt;SELECT id=&quot;SEL_4&quot;&gt;
&lt;option value=&quot;0&quot;&gt;D1&lt;/option&gt;
&lt;option value=&quot;1&quot;&gt;D2&lt;/option&gt;
&lt;option value=&quot;2&quot;&gt;D3&lt;/option&gt;
&lt;/SELECT&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_D5YECE');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_D5YECE');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>在这个例子中，后两个下拉选择框的值都会根据前一个下拉选择框值的改变而改变，可以使用类似的办法实现更复杂的功能，比如使用ajax来异步填充数据等</p>
]]></content:encoded>
			<wfw:commentRss>http://www.14px.com/?feed=rss2&amp;p=119</wfw:commentRss>
		</item>
	</channel>
</rss>
