<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>奔向远方 &#187; CSS</title>
	<atom:link href="http://www.tisswb.com/archives/category/web-technology/css-web-technology/feed" rel="self" type="application/rss+xml" />
	<link>http://www.tisswb.com</link>
	<description>结婚开始倒计时了，高兴~</description>
	<lastBuildDate>Tue, 19 Jul 2011 09:30:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>IE6、IE7、FF兼容性的详细CSS HACK介绍</title>
		<link>http://www.tisswb.com/archives/477.html</link>
		<comments>http://www.tisswb.com/archives/477.html#comments</comments>
		<pubDate>Thu, 09 Apr 2009 02:29:54 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web技术]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[网站开发]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=477</guid>
		<description><![CDATA[现在我大部分都是用!important来hack，对于ie6和firefox测试可以正常显示，但是ie7对! important可以正确解释，会导致页面没按要求显示！搜索了一下，找到一个针对IE7不错的hack方式就是使用“*+html”，现在用IE7浏 览一下，应该没有问题了。
现在写一个CSS可以这样：
#example { color: #333; } /* Moz */
* html #example { color: #666; } /* IE6 */
*+html #example { color: #999; } /* IE7 */
那么在firefox下字体颜色显示为#333，IE6下字体颜色显示为#666，IE7下字体颜色显示为#999，他们都互不干扰。我真希望那个IE6快点退休&#8230;&#8230;
css Hacks，css样式表补丁.用于修正XHTML编码设计的网页模板布局,某些层的溢出问题,HACKS出处:www.webdevout.net，这个CSS补丁(hacks)很简单，在样式表中单独为ie7设置某个元素，id或者class前面这样写:
<span class="readmore"><a href="http://www.tisswb.com/archives/477.html" title="IE6、IE7、FF兼容性的详细CSS HACK介绍" target="_blank">阅读全文——共3413字</a></span>]]></description>
			<content:encoded><![CDATA[<p>现在我大部分都是用!important来hack，对于ie6和firefox测试可以正常显示，但是ie7对! important可以正确解释，会导致页面没按要求显示！搜索了一下，找到一个针对IE7不错的hack方式就是使用“*+html”，现在用IE7浏 览一下，应该没有问题了。</p>
<p>现在写一个CSS可以这样：<br />
#example { color: #333; } /* Moz */<br />
* html #example { color: #666; } /* IE6 */<br />
*+html #example { color: #999; } /* IE7 */</p>
<p>那么在firefox下字体颜色显示为#333，IE6下字体颜色显示为#666，IE7下字体颜色显示为#999，他们都互不干扰。我真希望那个IE6快点退休&#8230;&#8230;</p>
<p>css Hacks，css样式表补丁.用于修正XHTML编码设计的网页模板布局,某些层的溢出问题,HACKS出处:www.webdevout.net，这个CSS补丁(hacks)很简单，在样式表中单独为ie7设置某个元素，id或者class前面这样写:</p>
<p>*:first-child+html #ID{}</p>
<p>或者</p>
<p>*:first-child+html .class{}<br />
别忘掉了前面的*,这个hacks使得DIV+CSS网页模板在ie5+,ie6,ie7,firefox 1.5,firefox 2的浏览器中都可以完美体现原始布局,而不会出现层溢出等问题.</p>
<p>IE7 修复了很多 bug，也增加了对一些选择符的支持，所以现在诸如 *html {} 和 html&gt;body {} 等针对 IE 隐藏或显示的 hack 都会在 IE7 中失效。虽然 CSS Hack 不推荐使用，条件注释才是万无一失的过滤器，但是条件注释只能出现在 HTML 中，CSS Hack 还是有用武之地的。Nanobot 发现了一些针对 IE7 的 CSS Hack，具体就是：</p>
<p>&gt;body<br />
html*<br />
*+html</p>
<p>这 三种写法，其中前两种都是不合法的 CSS 写法，在标准兼容浏览器中被被忽略，但是 IE7 却不这么认为。对于 &gt;body ，它会将缺失的选择符用全局选择符 * 代替，也就是将其处理成了 *&gt;body，而且不光对于 &gt; 选择符，+,~ 选择符中这个现象也存在。对于 html* ，由于 html 和 * 之间没有空格，所以也是一种 CSS 语法错误，但 IE7 不会忽略，而是错误地认为这里有一个空格。对于第三种 *+html，IE7 认为 html 前面的 DTD 声明也是一个元素，所以 html 会被选中，这三种方法中只有这一种方法是合法的 CSS 写法，也就是说可以通过校验器的验证，因此也是作者推荐的 hack 用法。</p>
<p>最后作者给出了最佳方式：</p>
<p>IE 6 and below<br />
Use * html {} to select the html element.<br />
IE 7 and below<br />
Use *+html, * html {} to select the html element.<br />
IE 7 only<br />
Use *+html {} to select the html element.<br />
IE 7 and modern browsers only<br />
Use html&gt;body {} to select the body element.<br />
Modern browsers only (not IE 7)<br />
Use html&gt;/**/body {} to select the body element.</p>
<p>The IE7 CSS Hack(!important在ie7.0的hack方法)</p>
<p>由 于ie对!important识别存在bug,而现在大部分网页标准设计师又通过这个bug来兼容ie和ff,但是ie7.0把这个bug给修复了,所以 问题又出现了,怎么兼容ie.7.0的同时又能兼容ie6.0和ff?正所谓&#8221;上有政策,下有对策&#8221;,国外的网页标准设计师通过使用css filter的办法(并不是css hack)来兼容ie7.0,ie6.0和ff,以下为作者从国外网站的翻译.</p>
<p>新建一个css样式如下：<br />
插入代码：<br />
#item {<br />
width: 200px;<br />
height: 200px;<br />
background: red;<br />
}<br />
新建一个div,并使用前面定义的css的样式：<br />
插入代码：<br />
some text here<br />
在body表现这里加入lang属性,中文为zh：<br />
插入代码：</p>
<p>现在对div元素再定义一个样式：<br />
插入代码：<br />
[/code]<br />
*:lang(en) #item{<br />
background:green !important;<br />
}<br />
[/code]<br />
这样做是为了用!important覆盖原来的css样式,由于:lang选择器ie7.0并不支持,所以对这句话不会有任何作用,于是也达到了ie6.0下同样的效果,但是很不幸地的是,safari同样不支持此属性,所以需要加入以下css样式：<br />
插入代码：<br />
#item:empty {<br />
background: green !important<br />
}<br />
:empty选择器为css3的规范,尽管safari并不支持此规范,但是还是会选择此元素,不管是否此元素存在,现在绿色会现在在除ie各版本以外的浏览器上,并在以下浏览器和操作系统下通过测试：<br />
ie7 beta 2 preview/win<br />
ie5.01+/win<br />
firefox 1.5/win<br />
opera 8.5/win &amp; linux<br />
netscape 7.01, 8/win<br />
mozilla 1.7.12/win &amp; linux<br />
safari 2/mac<br />
firefox 1.0.4/linux<br />
epiphany 1.4.8/linux<br />
galeon 1.3.20/linux</p>
<p>Screenshot of the IE7 css hack in IE7<br />
Screenshot of the IE7 css hack in Firefox 1.5</p>
<p>按照远作者的说法其实这不能算是一种hack,应该属于filter,不过这似乎并不是最重要的,因为通过这个办法,我们又一次了解决IE6.0,IE7.0和其他浏览器之间的兼容性问题,而且使用:lang-filter这办法,在今后的一段时间内都会有用.<br />
firefox,ie7,ie6兼容性问题，和css解决方案<br />
注：IE都能识别*;标准浏览器(如Firefox,Opera,Netscape)不能识别*；IE6能识别*，但不能识别 !important,IE7能识别*，也能识别!important;FF不能识别*，但能识别!important;</p>
<p>写两句代码来控制一个属性，区别Firefox与IE6：<br />
background:orange;*background:blue;</p>
<p>//这一句代码写出来时，你用firefox或其它非IE浏览时，会发现，写了该代码的区域背景是橙色的，如果用IE浏览，却是蓝色的，这是因为IE都能识别*;标准浏览器(如Firefox,Opera,Netscape)不能识别*；<br />
写两句代码来控制一个属性，区别IE7与IE6：<br />
background:green !important;background:blue;</p>
<p>//这一句代码写出来时，你用IE7浏览，会发现，写了该代码的区域背景是绿色的，如果用IE6浏览，却是蓝色的，这是因为IE7能识别! important*，一但识别了，就执行，忽略了后面的那一句，但IE6却不能识别!important，所以前面部分跳过，直接执行了后半部份。<br />
写两句代码来控制一个属性，区别Firefox与IE：<br />
background:orange; *background:green;</p>
<p>//这一句代码写出来时，你用Firefox浏览，会发现背景是橙色的，而IE里却是绿色的，很简单，因为Firefox不能识别*，而IE6，IE7都可以识*<br />
写三句代码来控制一个属性，区别Firefox，IE7，IE6：<br />
background:orange;*background:green !important;*background:blue;</p>
<p>//这一句会使在Firefox在，背景呈橙色，IE7中为绿色，IE6中为蓝色，道理和前面一样，Firefox不能识别*，所以后面两句都不执 行，直 接执行第一句，IE7当然也能执行第一行代码，但是因为第二句，他也能识别，所以就执行了第二句代码，把前面的效果给过滤了，而最后一句，IE7是不能识 别的。IE6不能识别!imprtant，本来运行了第一句代码了，第二句不能识别，那就理所当然的执行了最后一句。</p>
<p>来源：<a href="http://tanliping192.blog.163.com/blog/static/1792149820089872386/" target="_blank">http://tanliping192.blog.163.com/blog/static/1792149820089872386/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/477.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>E7、IE6和火狐兼容性问题解决方案</title>
		<link>http://www.tisswb.com/archives/474.html</link>
		<comments>http://www.tisswb.com/archives/474.html#comments</comments>
		<pubDate>Thu, 09 Apr 2009 02:25:50 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web技术]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[网站开发]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=474</guid>
		<description><![CDATA[一、CSS HACK
以下两种方法几乎能解决现今所有HACK。
1、!important
随着IE7对!important的支持，!important 方法现在只针对IE6的HACK。
（注意写法.记得该声明位置需要提前）
程序代码&#60;style&#62;
#wrapper
{
width: 100px!important; /* IE7+FF */
width: 80px; /* IE6 */
<span class="readmore"><a href="http://www.tisswb.com/archives/474.html" title="E7、IE6和火狐兼容性问题解决方案" target="_blank">阅读全文——共2612字</a></span>]]></description>
			<content:encoded><![CDATA[<p><strong>一、CSS HACK</strong></p>
<p>以下两种方法几乎能解决现今所有HACK。<br />
<strong>1、!important</strong><br />
随着IE7对!important的支持，!important 方法现在只针对IE6的HACK。<br />
（注意写法.记得该声明位置需要提前）<br />
程序代码&lt;style&gt;<br />
#wrapper<br />
{<br />
width: 100px!important; /* IE7+FF */<br />
width: 80px; /* IE6 */<br />
}<br />
&lt;/style&gt;</p>
<p><strong>2、IE6/IE77对FireFox</strong><br />
*+html 与 *html 是IE特有的标签，firefox 暂不支持。<br />
而*+html 又为 IE7特有标签。<br />
程序代码&lt;style&gt;<br />
#wrapper<br />
{<br />
#wrapper { width: 120px; } /* FireFox */<br />
*html #wrapper { width: 80px;} /* ie6 fixed */<br />
*+html #wrapper { width: 60px;} /* ie7 fixed, 注意顺序 */<br />
}<br />
&lt;/style&gt;注意，*+html 对IE7的HACK 必须保证HTML顶部有如下声明：<br />
程序代码&lt;!DOCTYPE HTML PUBLIC &#8220;-//W3C//DTD HTML 4.01 Transitional//EN&#8221;　&#8221;http://www.w3.org/TR/html4/loose.dtd&#8221;&gt;<br />
<strong>二、万能 float 闭合（非常重要）</strong></p>
<p>关于 clear float 的原理可参见 [How To Clear Floats Without Structural Markup]<br />
将以下代码加入Global CSS 中，给需要闭合的div加上 class=&#8221;clearfix&#8221; 即可，屡试不爽。<br />
程序代码&lt;style&gt;<br />
/* Clear Fix */</p>
<p>.clearfix:after<br />
{<br />
content:&#8221;.&#8221;;<br />
display:block;<br />
height:0;<br />
clear:both;<br />
visibility:hidden;<br />
}<br />
.clearfix<br />
{<br />
display:inline-block;<br />
}<br />
/* Hide from IE Mac \*/<br />
.clearfix {display:block;}<br />
/* End hide from IE Mac */<br />
/* end of clearfix */<br />
&lt;/style&gt;</p>
<p><strong>三、其他兼容技巧（再次啰嗦）</strong></p>
<p>1、FF下给 div 设置 padding 后会导致 width 和 height 增加，但IE不会。（可用!important解决）<br />
2、居中问题。<br />
1) 垂直居中。将 line-height 设置为 当前 div 相同的高度，再通过 vertical-align: middle. （注意内容不要换行）<br />
2) 水平居中。 margin: 0 auto; （当然不是万能）<br />
3、若需给 a 标签内内容加上 样式，需要设置 display: block; （常见于导航标签）<br />
4、FF 和 IE 对 BOX 理解的差异导致相差 2px 的还有设为 float 的 div 在 ie 下 margin 加倍等问题。<br />
5、ul 标签在 FF 下面默认有 list-style 和 padding 。最好事先声明，以避免不必要的麻烦。（常见于导航标签和内容列表）<br />
6、作为外部 wrapper 的 div 不要定死高度，最好还加上 overflow: hidden ，以达到高度自适应。<br />
7、关于手形光标。 cursor: pointer ，而 hand 只适用于 IE。<br />
8、至于IE5以及其他浏览器就没有必要兼顾了，在这上面花时间不值得。</p>
<p>下面这段可执行的码可以很形象的说明问题&#8230;当然前提是你有IE6 IE7和火狐浏览器&#8230;<br />
不过我还是没有研究透&#8230;需要注意的是&#8230;在&lt;body&gt;标签里加了 lang=&#8221;zh&#8221; 的定义&#8230;<br />
&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;&lt;a href=&#8221;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221; target=&#8221;_blank&#8221;&gt;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&lt;/a&gt;&#8221;&gt;<br />
&lt;html xmlns=&#8221;&lt;a href=&#8221;http://www.w3.org/1999/xhtml&#8221; target=&#8221;_blank&#8221;&gt;http://www.w3.org/1999/xhtml&lt;/a&gt;&#8221;&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=gb2312&#8243; /&gt;<br />
&lt;title&gt;通过CSS Hack 区分 FX/IE7/IE6/IE5.5/IE5&lt;/title&gt;<br />
&lt;style type=&#8221;text/css&#8221;&gt;<br />
&lt;!&#8211;</p>
<p>#fx {<br />
display: none;<br />
border: 3px double #999;<br />
width:300px;<br />
height:200px;<br />
padding:10px;<br />
}<br />
#ie6{<br />
display:none !important;<br />
display:none;/*ie5*/<br />
font-size:54px;<br />
border:10px solid #CCC;<br />
padding:100px;<br />
}<br />
#ie6/**/{<br />
display:block;<br />
display /*ie5.5*/:none;<br />
}<br />
#ie7 {<br />
display:block !important;<br />
display:none;/*ie5 &amp; ie6*/<br />
background-color:#69f;<br />
border:1px dashed #63c;<br />
padding:50px;<br />
width:200px;<br />
height:150px;</p>
<p>}<br />
*:lang(zh) #ie7{<br />
display:none !important;<br />
}<br />
*:lang(zh) #fx{<br />
display:block !important;<br />
}</p>
<p>&#8211;&gt;</p>
<p>#example{color:red ;}<br />
* html #example{color:blue;}<br />
*+html #example{color:green;}<br />
&lt;/style&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body lang=&#8221;zh&#8221;&gt;<br />
&lt;div id=&#8221;fx&#8221;&gt;这是在 FireFox 或者 Opera 下面的效果&lt;/div&gt;<br />
&lt;div id=&#8221;ie6&#8243;&gt;这是在 IE 6 下面的效果&lt;/div&gt;<br />
&lt;div id=&#8221;ie7&#8243;&gt;这是在 IE 7 下面的效果&lt;/div&gt;</p>
<p>&lt;div&gt;以下为简单区分FF/IE6/IE7示例&lt;/div&gt;<br />
&lt;div id=&#8221;example&#8221;&gt;这行文字在FF下应为红色，在IE6下应为蓝色，在IE7下应为绿色。&lt;/div&gt;<br />
&lt;/body&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/474.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE6,IE7,FF等浏览器CSS不兼容原因及解决办法</title>
		<link>http://www.tisswb.com/archives/472.html</link>
		<comments>http://www.tisswb.com/archives/472.html#comments</comments>
		<pubDate>Thu, 09 Apr 2009 02:22:45 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web技术]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[网站开发]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=472</guid>
		<description><![CDATA[做网站的前端开发有多痛苦？看看浏览器的兼容性调整就可以知道了，人人深恶痛绝，可惜各大浏览器依然故我，把永远的痛通通给了我们。为了解决浏览器不兼容的情况，不知有多少人苦苦冥思哈。浏览器的不兼容，大家肯定都是深恶痛绝的，往往我们只是去做修补，却忘了更重要的事情，那就是追溯根源，避免类似的不兼容再次出现。在下不才，归纳几点html编码要素，望能指点各位：
1.文字本身的大小不兼容。同样是font-size:14px的宋体文字，在不同浏览器下占的空间是不一样的，ie下实际占高16px，下留白3px，ff下实际占高17px，上留白1px，下留白3px，opera下就更不一样了。解决方案：给文字设定 line-height 。确保所有文字都有默认的 line-height 值。这点很重要，在高度上我们不能容忍1px 的差异。
2.ff下容器高度限定，即容器定义了height之后，容器边框的外形就确定了，不会被内容撑大，而ie下是会被内容撑大，高度限定失效。所以不要轻易给容器定义height。
<span class="readmore"><a href="http://www.tisswb.com/archives/472.html" title="IE6,IE7,FF等浏览器CSS不兼容原因及解决办法" target="_blank">阅读全文——共4225字</a></span>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">做网站的前端开发有多痛苦？看看浏览器的兼容性调整就可以知道了，人人深恶痛绝，可惜各大浏览器依然故我，把永远的痛通通给了我们。为了解决浏览器不兼容的情况，不知有多少人苦苦冥思哈。浏览器的不兼容，大家肯定都是深恶痛绝的，往往我们只是去做修补，却忘了更重要的事情，那就是追溯根源，避免类似的不兼容再次出现。在下不才，归纳几点html编码要素，望能指点各位：</p>
<p style="text-align: justify;">1.文字本身的大小不兼容。同样是font-size:14px的宋体文字，在不同浏览器下占的空间是不一样的，ie下实际占高16px，下留白3px，ff下实际占高17px，上留白1px，下留白3px，opera下就更不一样了。解决方案：<span style="color: #ff0000;">给文字设定 line-height 。确保所有文字都有默认的 line-height 值。</span>这点很重要，在高度上我们不能容忍1px 的差异。</p>
<p style="text-align: justify;">2.ff下容器高度限定，即容器定义了height之后，容器边框的外形就确定了，不会被内容撑大，而ie下是会被内容撑大，高度限定失效。所以<span style="color: #ff0000;">不要轻易给容器定义height</span>。</p>
<p style="text-align: justify;">3.还讨论内容撑破容器问题，横向上的。如果float 容器未定义宽度，ff下内容会尽可能撑开容器宽度，ie下则会优先考虑内容折行。故，<span style="color: #ff0000;">内容可能撑破的浮动容器需要定义width</span>。</p>
<p style="text-align: justify;">小实验：有兴趣大家可以看看这段实验。在不同浏览器下分别测试以下各项代码。<br />
a.&lt;div style=&#8221;border:1px solid red;height:10px&#8221;&gt;&lt;/div&gt;  b.&lt;div style=&#8221;border:1px solid red;width:10px&#8221;&gt;&lt;/div&gt;
</p>
<p style="text-align: justify;">c.&lt;div style=&#8221;border:1px solid red;float:left&#8221;&gt;&lt;/div&gt;        d.&lt;div style=&#8221;border:1px solid red;overflow:hidden&#8221;&gt;&lt;/div&gt;</p>
<p style="text-align: justify;">上面的代码在不同浏览器中是不一样的，实验起源于对小height 值div 的运用，&lt;div style=&#8221;height:10px;overflow:hidden&#8221;&gt;&lt;/div&gt;，小height 值要配合overflow:hidden一起使用。实验好玩而已，想说明的是，浏览器对容器的边界解释是大不相同的，容器内容的影响结果各不相同。</p>
<p style="text-align: justify;">4.浮动的清除，<span style="color: #ff0000;">ff下不清除浮动是不行的</span>。</p>
<p style="text-align: justify;">纠正大家一个误区，遇到不兼容就说ff烂是不对的，其实更多时候是ie的奇怪表现让我们无所适从。以下列出ie6的种种劣迹。</p>
<p style="text-align: justify;">5.最被痛恨的，<span style="color: #ff0000;">double-margin bug</span>。ie6下给浮动容器定义margin-left 或者margin-right 实际效果是数值的2倍。解决方案，<span style="color: #ff0000;">给浮动容器定义display:inline</span>。</p>
<p style="text-align: justify;">6.mirrormargin bug，当外层元素内有float元素时，外层元素如定义margin-top:14px，将自动生成margin-bottom:14px。 padding也会出现类似问题，都是ie6下的特产，该类bug 出现的情况较为复杂，远不只这一种出现条件，还没系统整理。解决方案：<span style="color: #ff0000;">外层元素设定border 或 设定float。</span></p>
<p style="text-align: justify;">引申：ff 和ie 下对容器的margin-bottom，padding-bottom的解释有时不一致，似乎与之相关。</p>
<p style="text-align: justify;">7.吞吃现象，限于篇幅，我就不展开了。还是ie6，上下两个div，上面的div设置背景，却发现下面没有设置背景的div 也有了背景，这就是吞吃现象。对应上面的<span style="color: #ff0000;">背景吞吃现象，还有滚动下边框缺失的现象</span>。解决方案：<span style="color: #ff0000;">使用zoom:1。</span>这个zoom好象是专门为解决ie6 bug而生的。</p>
<p style="text-align: justify;">8.<span style="color: #ff0000;">注释也能产生bug</span>~~~&#8221;多出来的一只猪。&#8221;这是前人总结这个bug使用的文案，ie6的这个bug 下，大家会在页面看到猪字出现两遍，重复的内容量因注释的多少而变。解决方案：<span style="color: #ff0000;">用&#8221;&lt;!-[if !IE]&gt; picRotate start &lt;![endif]-&gt;&#8221;方法写注释。</span></p>
<p style="text-align: justify;">9.<span style="color: #ff0000;">&lt;li/&gt;里加 float &lt;div/&gt;</span>，这是一个典型的，棘手的兼容问题，希望引起大家正视，<span style="color: #ff0000;">给li 不同的属性会有不同的解释效果</span>，ff下的解释稍可理解，ie6下的解释会让你摸不着头脑，由于问题的复杂性，将另起一文专门讨论该问题。在《ul使用心得》一文里有相关成果，却没给出问题解决的过程。</p>
<p style="text-align: justify;">10.<span style="color: #ff0000;">使用了&#8221;float:left;display:inline&#8221;的ul的奇怪表现。</span>可以看出这句css是针对ie6下的double margin bug 而加上的display:inline，这也是我的css体系里的重要一环，在《ul使用心得》一文中有相关阐述。而这句css用在ul上会让你痛苦不堪。点到为止，这里不能多说哈。</p>
<p style="text-align: justify;">11.<span style="color: #ff0000;">img下的留白</span>，大家看这段代码有啥问题：</p>
<p style="text-align: justify;">&lt;div&gt;<br />
&lt;img src=&#8221;" mce_src=&#8221;" /&gt;<br />
&lt;/div&gt;
</p>
<p style="text-align: justify;">把div的border打开，你发现图片底部不是紧贴着容器底部的，是img后面的空白字符造成，要消除必须这样写</p>
<p style="text-align: justify;">&lt;div&gt;<br />
&lt;img src=&#8221;" mce_src=&#8221;" /&gt;&lt;/div&gt;
</p>
<p style="text-align: justify;"><span style="color: #ff0000;">后面两个标签要紧挨着</span>。ie7下这个bug 依然存在。解决方案：<span style="color: #ff0000;">给img设定 display:block。</span></p>
<p style="text-align: justify;">12.<span style="color: #ff0000;">失去line-height。</span>&lt;div style=&#8221;line-height:20px&#8221;&gt;&lt;img /&gt;文字&lt;/div&gt;，很遗憾，在ie6下单行文字 line-height 效果消失了。。。，原因是&lt;img /&gt;这个inline-block元素和inline元素写在一起了。解决方案：<span style="color: #ff0000;">让img 和文字都 float起来。</span></p>
<p style="text-align: justify;">引申：大家知道img 的align 有 text-top，middle，absmiddle啊什么的，你可以尝试去调整img 和文字让他们在ie和ff下能一致，你会发现怎么调都不会让你满意。<span style="color: #ff0000;">索性让img 和文字都 float起来，用margin 调整。</span></p>
<p style="text-align: justify;">13.<span style="color: #ff0000;">链接的hover状态</span>。a:hover img{width:300px} 我们想让鼠标hover时，链接里包含的图片宽度变化，可惜在<span style="color: #ff0000;">ie6下无效，ie7、ff下有效。</span></p>
<p style="text-align: justify;">14.<span style="color: #ff0000;">非链接的hover状态。</span>div:hover{} 这样的样式<span style="color: #ff0000;">ie6是不认的，在ie7、ff下才有效果</span>。</p>
<p style="text-align: justify;">15.<span style="color: #ff0000;">block化的a链接，其内套absolute层，absolute层内放置img，ie下，鼠标点击img不会有链接效果，ff、op下正常。</span></p>
<p style="text-align: justify;">想不出来了，以后想到再加吧。上面的诸多问题如果你掌握了其中奥妙，90%的不兼容问题不需要另起css hack的。</p>
<p style="text-align: justify;">16.<span style="color: #ff0000;">无法彻底清除的float。</span>如果让ul下的li具有了float属性，如何clear浮动的li 呢？&lt;ul&gt;&lt;li class=&#8221;c&#8221;&gt;&lt;/li&gt;&lt;/ul&gt; 或者 &lt;ul&gt;&lt;li&gt;&lt;div class=&#8221;c&#8221;&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt; 或者 &lt;ul&gt;&lt;li&gt;&lt;/li&gt;&lt;div&gt;class=&#8221;c&#8221;&gt;&lt;/div&gt;&lt;/ul&gt; 或者 &lt;ul&gt;&lt;li&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;class=&#8221;c&#8221;&gt;&lt;/div&gt; 或者上述的组合？这个问题，我无法给出解答。下面有个例子与此相关</p>
<p style="text-align: justify;">&lt;!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&gt;</p>
<p style="text-align: justify;">&lt;style type=text/css&gt;<br />
.c{clear:both;overflow:hidden;+overflow:visible}<br />
.bd{border:1px solid red}</p>
<p style="text-align: justify;">ul.ex{list-style:none;}<br />
ul.ex li{float:left;border:1px solid green;}<br />
&lt;/style&gt;<br />
&lt;ul class=ex&gt;<br />
&lt;li&gt;sfsdfsfdf&lt;/li&gt;<br />
&lt;li&gt;sfsdfsfdf&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;div class=c&gt;&lt;/div&gt;<br />
&lt;div class=bd style=margin-top:19px&gt;sfsdfsfdf&lt;/div&gt;
</p>
<p style="text-align: justify;">请在ie下 测试，仅仅将 margin-top:19px 改为margin-top:20px 你发现什么了？要素：doctype必须有，ie6、ie7下margin-top:19px还好好的，margin-top:20px 就出问题了，无法解释。。。大家还可以将 clear 层换不同的位置测试。</p>
<p style="text-align: justify;">解决方案：给ul 属性zoom:1 （给li 加zoom:1 没用）</p>
<p style="text-align: justify;">引申：<span style="color: #ff0000;">clear层应该单独使用。</span>也许你为了节省代码把clear属性直接放到下面的一个内容层，这样有问题，不仅仅是ff和op下失去margin效果，ie下某些margin值也会失效<br />
&lt;div style=&#8221;background:red;float:left;&#8221;&gt;dd&lt;/div&gt;<br />
&lt;div style=&#8221;clear:both;margin-top:18px;background:green&#8221;&gt;ff&lt;/div&gt;
</p>
<p style="text-align: justify;">17.ie下overflow:hidden对其下的绝对层position:absolute或者相对层 position:relative无效。解决方案：<span style="color: #ff0000;">给overflow:hidden加position:relative或者 position:absolute。另，ie6支持overflow-x或者overflow-y的特性，ie7、ff不支持。</span></p>
<p style="text-align: justify;">18.ie6下严重的bug，float元素如没定义宽度，内部如有div定义了height或zoom:1，这个div就会占满一整行，即使你给了宽度。<span style="color: #ff0000;">float元素如果作为布局用或复杂的容器，都要给个宽度的。</span></p>
<p style="text-align: justify;">19.ie6下的bug，绝对定位的div下包含相对定位的div，如果给内层相对定位的div高度height具体值，内层相对层将具有100%的width值，外层绝对层将被撑大。解决方案<span style="color: #ff0000;">给内层相对层float属性。</span></p>
<p style="text-align: justify;">20.ie6下的bug，&lt;head&gt;&lt;/head&gt;内有&lt;base target=&#8221;_blank&#8221;/&gt;的情况下，position:relative层下的float层内文字无法选中。这个bug迫使我修公用样式库。</p>
<p style="text-align: justify;">21.终于来了个ff的缺点。width:100%这个东西在ie里用很方便，会向上逐层搜索width值，忽视浮动层的影响，<span style="color: #ff0000;">ff下搜索至浮动层结束，如此，只能给中间的所有浮动层加width:100%才行</span>，累啊。opera这点倒学乖了跟了ie。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/472.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>惊奇CSS：25 个高级CSS技巧</title>
		<link>http://www.tisswb.com/archives/453.html</link>
		<comments>http://www.tisswb.com/archives/453.html#comments</comments>
		<pubDate>Sun, 29 Mar 2009 16:39:21 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web技术]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[div]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=453</guid>
		<description><![CDATA[CSS是一个为网友文档添加诸如字体、颜色和间隔等属性的机制。我喜欢使用CSS，胜于JavaScript 和 jQuery，如果相同的功能可以通过CSS和JavaScript实现时，那么建议使用CSS。或许有些设计师会表达不同意见——CSS缺少动态特性。真是这样吗？我们来看看CSS的高级技巧吧。
1. CSS 实现文字和背景渐变 

 
转自：http://www.kooxo.com/tutorial/webdesign/css/200903/28-92.html

难道通过CSS实现背景的渐变不比通过图片实现更好吗？因为这能使网页更快地加载。

使用纯CSS实现 渐变 
使用 CSS 实现背景的渐变
<span class="readmore"><a href="http://www.tisswb.com/archives/453.html" title="惊奇CSS：25 个高级CSS技巧" target="_blank">阅读全文——共2451字</a></span>]]></description>
			<content:encoded><![CDATA[<p>CSS是一个为网友文档添加诸如字体、颜色和间隔等属性的机制。我喜欢使用CSS，胜于JavaScript 和 jQuery，如果相同的功能可以通过CSS和JavaScript实现时，那么建议使用CSS。或许有些设计师会表达不同意见——CSS缺少动态特性。真是这样吗？我们来看看CSS的高级技巧吧。</p>
<h3><span style="TEXT-DECORATION: underline">1. CSS 实现文字和背景渐变 </span></h3>
<p style="TEXT-ALIGN: center" align="center"><span style="TEXT-DECORATION: underline"><a href="http://www.kooxo.com/uploads/allimg/090328/2307540.jpg"><img class="aligncenter size-full wp-image-1771" title="css_gradient" src="http://www.kooxo.com/uploads/allimg/090328/2307540.jpg" alt="css_gradient" width="500" height="411" /></a></span></p>
<p style="TEXT-ALIGN: center"><span style="TEXT-DECORATION: underline"></span> </p>
<p>转自：<a href="http://www.kooxo.com/tutorial/webdesign/css/200903/28-92.html">http://www.kooxo.com/tutorial/webdesign/css/200903/28-92.html</a>
</p>
<p align="left">难道通过CSS实现背景的渐变不比通过图片实现更好吗？因为这能使网页更快地加载。</p>
<ul>
<li><a href="http://www.designdetector.com/2005/09/css-gradients-demo.php" target="_blank">使用纯CSS实现 渐变</a> </li>
<li><a href="http://www.tankedup-imaging.com/css_dev/css-gradient.html" target="_blank">使用 CSS 实现背景的渐变</a></li>
</ul>
<p>文字的渐变又如何实现呢？</p>
<p style="TEXT-ALIGN: center" align="center"><a href="http://www.kooxo.com/uploads/allimg/090328/2307541.jpg"><img class="aligncenter size-full wp-image-1660" title="gradient_text" src="http://www.kooxo.com/uploads/allimg/090328/2307541.jpg" alt="gradient_text" width="379" height="132" /></a></p>
<ul>
<li><a href="http://www.webdesignerwall.com/tutorials/css-gradient-text-effect/" target="_blank">CSS 文字渐变特效</a></li>
<li><a href="http://cssglobe.com/lab/textgradient/" target="_blank">纯CSS实现文字渐变 </a></li>
</ul>
<h2><span style="TEXT-DECORATION: underline">2.使用Z-index实现图像层叠</span></h2>
<p style="TEXT-ALIGN: center" align="center"><span style="TEXT-DECORATION: underline"><a href="http://www.kooxo.com/uploads/allimg/090328/2307542.jpg"><img class="aligncenter size-full wp-image-1662" title="z-index" src="http://www.kooxo.com/uploads/allimg/090328/2307542.jpg" alt="z-index" width="270" height="177" /></a></span></p>
<p>使用z-index 属性来设置一批元素的层叠次序，你可以设置一张图像显示在另一张图像或文本之上。</p>
<ul>
<li><a href="http://www.tjkdesign.com/articles/z-index/teach_yourself_how_elements_stack.asp" target="_blank">认识  Z-Index </a></li>
<li><a href="http://www.quackit.com/css/properties/css_z-index.cfm" target="_blank">CSS Z-index</a></li>
</ul>
<h2><span style="TEXT-DECORATION: underline">3. 使用CSS创建特殊边框 </p>
<p></span></h2>
<p style="TEXT-ALIGN: center" align="center"><img class="aligncenter size-full wp-image-1664" title="border" src="http://www.kooxo.com/uploads/allimg/090328/2307543.jpg" alt="border" width="400" height="120" /></p>
<ul>
<li><a href="http://www.copysense.co.uk/border.php" target="_blank">CSS Box Border test</a> : This utility enables the sampling of Cascading Style Sheet (CSS) border styles, and creates the corresponding CSS code for implementation.</li>
<li><a href="http://www.css3.info/preview/border-image/" target="_blank">Border-image CSS3</a> only.</li>
<li><a href="http://pmob.co.uk/pob/side-borders.htm" target="_blank">CSS Side Border</a> Image Using CSS.</li>
</ul>
<p align="center"><img class="aligncenter size-full wp-image-1704" title="star" src="http://www.kooxo.com/uploads/allimg/090328/2307544.jpg" alt="star" width="256" height="236" /></p>
<ul>
<li><a href="http://phoenity.com/newtedge/scalable_star/" target="_self">Create a Scalable Star using using CSS border</a></li>
<li><a href="http://infimum.dk/HTML/slantinfo.html" target="_blank">Border Slants </a></li>
</ul>
<h2 class="title"><span style="TEXT-DECORATION: underline">4. A Cool CSS Effect &#8211; Dashboard </span></h2>
<p align="center"><img class="aligncenter size-full wp-image-1666" title="osx" src="http://www.kooxo.com/uploads/allimg/090328/2307545.jpg" alt="osx" width="450" height="387" /></p>
<ul>
<li>Create a<a href="http://dbachrach.com/blog/2006/10/09/a-cool-css-effect-dashboard/" target="_blank"> Dashboard</a> like effect using CSS.</li>
</ul>
<h2>5. 使用CSS创建<span style="TEXT-DECORATION: underline"> 2D/3D 按钮</span></h2>
<table border="0" align="center">
<tbody>
<tr>
<td><img class="aligncenter size-full wp-image-1667" title="css_button" src="http://www.kooxo.com/uploads/allimg/090328/2307546.jpg" alt="css_button" width="221" height="103" /></td>
<td>
<p align="center"><img class="aligncenter size-full wp-image-1668" title="css_button2" src="http://www.kooxo.com/uploads/allimg/090328/2307547.jpg" alt="css_button2" width="325" height="67" /></p>
</td>
</tr>
</tbody>
</table>
<p>Create some cool looking buttons using CSS only.</p>
<ul>
<li><a href="http://cssglobe.com/post/1614/4-uber-cool-css-techniques-for-links" target="_blank">3D Rollover Button using CSS</a></li>
<li><a href="http://www.oscaralexander.com/tutorials/how-to-make-sexy-buttons-with-css.html" target="_blank">How to make sexy buttons with CSS</a></li>
<li><a href="http://www.webcredible.co.uk/user-friendly-resources/css/rollover-buttons.shtml" target="_blank">CSS rollover buttons</a></li>
</ul>
<h2><span style="TEXT-DECORATION: underline">6. 用CSS实现文本的浮雕和阴影特效</span></h2>
<p>Using this technique you can create iPhone like embossed Text</p>
<p align="center"><span style="TEXT-DECORATION: underline"><img class="aligncenter size-full wp-image-1674" title="CSS_emboss" src="http://www.kooxo.com/uploads/allimg/090328/2307548.png" alt="CSS_emboss" width="299" height="75" /></span></p>
<div class="dp-highlighter">
<div class="bar">
<div class="tools"><a onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="http://desizntech.info/2009/03/discover-the-cool-of-css-25-advanced-css-techniques/#">view plain</a><a onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;" href="http://desizntech.info/2009/03/discover-the-cool-of-css-25-advanced-css-techniques/#">copy to clipboard</a><a onclick="dp.sh.Toolbar.Command('PrintSource',this);return false;" href="http://desizntech.info/2009/03/discover-the-cool-of-css-25-advanced-css-techniques/#">print</a><a onclick="dp.sh.Toolbar.Command('About',this);return false;" href="http://desizntech.info/2009/03/discover-the-cool-of-css-25-advanced-css-techniques/#">?</a></div>
</div>
<ol class="dp-css">
<li class="alt"><span><span class="value">1</span><span>. </span><span class="keyword">text-shadow</span><span>: </span><span class="value">0px</span><span> </span><span class="value">1px</span><span> </span><span class="value">0px</span><span> </span><span class="value">#e5e5ee</span><span>;  </span></span></li>
</ol>
</div>
<pre class="css" style="DISPLAY: none">   1. text-shadow: 0px 1px 0px #e5e5ee;</pre>
<ul>
<li><a href="http://www.reynoldsftw.com/2009/03/text-embossing-technique-with-css/" target="_blank">Text Embossing</a></li>
<li><a href="http://www.designmeme.com/articles/dropshadows/" target="_blank">CSS Text Drop Shadows</a></li>
</ul>
<h2><span style="TEXT-DECORATION: underline">7. 使用 CSS 为文本链接添加图标</span></h2>
<p><span style="TEXT-DECORATION: underline"> </p>
<p align="center"><img class="aligncenter size-full wp-image-1678" title="icon_text" src="http://www.kooxo.com/uploads/allimg/090328/2307549.jpg" alt="icon_text" width="333" height="102" /></p>
<p> </p>
<p></span></p>
<ul>
<li><a href="http://pooliestudios.com/projects/iconize/">Add icon to the hyperlink.</a></li>
<li><a href="http://pooliestudios.com/projects/iconize/" target="_blank">Iconize Textlinks with CSS</a></li>
</ul>
<h2>8. <span style="TEXT-DECORATION: underline">CSS 格式化引用内容</span></h2>
<p align="center"><img class="aligncenter size-full wp-image-1686" title="qoutes" src="http://www.kooxo.com/uploads/allimg/090328/23075410.jpg" alt="qoutes" width="500" height="135" /></p>
<ul>
<li><a href="http://www.designmeme.com/articles/csscurlyquotes/" target="_blank">Curly Quotes with Pure CSS</a></li>
<li><a rel="bookmark" href="http://24ways.org/2005/swooshy-curly-quotes-without-images">Swooshy Curly Quotes Without Images</a></li>
</ul>
<h2><span style="TEXT-DECORATION: underline">9. 使用CSS透明属性实现超酷特效 </span></h2>
<p align="center"><span style="TEXT-DECORATION: underline"><img class="aligncenter size-full wp-image-1688" title="css_opacity_menu" src="http://www.kooxo.com/uploads/allimg/090328/23075411.jpg" alt="css_opacity_menu" width="500" height="168" /></span></p>
<ul>
<li><a href="http://www.cssplay.co.uk/menus/flyout_horizontal.html" target="_blank">A CSS only fly-out menu with transparency</a></li>
<li><a href="http://www.tankedup-imaging.com/css_dev/menu2.html" target="_blank">CSS Menu using CSS opacity property</a></li>
<li><a href="http://www.mandarindesign.com/opacityblending.html" target="_blank"><strong>Opacity Background Blending Effects</strong></a>
<p align="center"><img class="aligncenter size-full wp-image-1690" title="css_watermark" src="http://www.kooxo.com/uploads/allimg/090328/23075412.jpg" alt="css_watermark" width="400" height="143" /></p>
</li>
<li><a href="http://www.freecssmenus.co.uk/menu_opacity.php" target="_blank">Transparency Menu Watermark on an image</a></li>
</ul>
<h2>10. 模糊的背景特效</h2>
<p align="center"><img class="aligncenter size-full wp-image-1693" title="blurry_bg" src="http://www.kooxo.com/uploads/allimg/090328/23075413.jpg" alt="blurry_bg" width="500" height="267" /></p>
<ul>
<li>CSS Guru Chris Coyier explains<a href="http://css-tricks.com/blurry-background-effect/" target="_blank"> h</a><a href="http://css-tricks.com/blurry-background-effect/" target="_blank">ow to create a blurry background using CSS</a></li>
</ul>
<h2>11. CSS视差特效</h2>
<p align="center"><img class="aligncenter size-full wp-image-1695" title="parallax" src="http://www.kooxo.com/uploads/allimg/090328/23075414.jpg" alt="parallax" width="497" height="180" /></p>
<ul>
<li><a href="http://forthelose.org/examples-of-and-how-to-do-the-css-parallax-effect" target="_blank">Examples of and How to Create the CSS Parallax Effect</a></li>
<li><a href="http://demo.marcofolio.net/a_parallax_illusion_with_css/" target="_blank">A parallax illusion with CSS: The Horse in Motion </a></li>
</ul>
<h2><span style="TEXT-DECORATION: underline">12.仅使用CSS创建 Lightbox 图像特效</span></h2>
<p align="center"><span style="TEXT-DECORATION: underline"><img class="aligncenter size-full wp-image-1697" title="css_lightbox" src="http://www.kooxo.com/uploads/allimg/090328/23075415.jpg" alt="css_lightbox" width="400" height="213" /></span></p>
<ul>
<li>Here is another useful  <a href="http://www.emanueleferonato.com/2007/08/22/create-a-lightbox-effect-only-with-css-no-javascript-needed/" target="_blank">technique </a>that is using CSS and a little Javascript to create the lightbox effect.</li>
</ul>
<h2><span style="TEXT-DECORATION: underline">13. 纯CSS实现折叠特效</span></h2>
<p align="center"><span style="TEXT-DECORATION: underline"><img class="aligncenter size-full wp-image-1699" title="css_accordian" src="http://www.kooxo.com/uploads/allimg/090328/23075416.jpg" alt="css_accordian" width="367" height="300" /></span></p>
<ul>
<li>This post explains how to <a href="http://www.cssnewbie.com/css-only-accordion/" target="_blank">create Accordion using CSS</a><span style="TEXT-DECORATION: underline"><br />
</span></li>
</ul>
<h2><span style="TEXT-DECORATION: underline">14. <span class="taggedlink">使用简单CSS 实现文本修饰效果 </span></span></h2>
<p align="center"><span style="TEXT-DECORATION: underline"><span class="taggedlink"><a href="http://www.jankoatwarpspeed.com/post/2008/08/09/Add-grunge-effect-to-text-using-simple-CSS.aspx" target="_blank"><img class="aligncenter size-full wp-image-1701" title="grunge1" src="http://www.kooxo.com/uploads/allimg/090328/23075417.jpg" alt="grunge1" width="294" height="72" /></a></span></span></p>
<ul>
<li>In this short <a href="http://www.jankoatwarpspeed.com/post/2008/08/09/Add-grunge-effect-to-text-using-simple-CSS.aspx" target="_blank">tutorial </a>you will see how to add grunge effect to your text using just CSS and one image.</li>
</ul>
<h2><span style="TEXT-DECORATION: underline"><span class="taggedlink">15.</span>创建区块或元素悬停效果</span></h2>
<p align="center"><span style="TEXT-DECORATION: underline"><img class="aligncenter size-full wp-image-1707" title="block_hover" src="http://www.kooxo.com/uploads/allimg/090328/23075418.jpg" alt="block_hover" width="430" height="283" /></span></p>
<ul>
<li><a href="http://www.smileycat.com/miaow/archives/000230.php" target="_blank">Learn how to create a block hover effect for a list of links</a></li>
<li><a href="http://phoenity.com/newtedge/element_hover/" target="_blank">CSS element hover effect.</a></li>
</ul>
<h2><span style="TEXT-DECORATION: underline">16. 使用CSS实现抖动效果</span></h2>
<p align="center"><img class="aligncenter size-full wp-image-1709" title="dither" src="http://www.kooxo.com/uploads/allimg/090328/23075419.jpg" alt="dither" width="500" height="168" /></p>
<ul>
<li>Dezinerfolio shows how to create a <a href="http://www.dezinerfolio.com/2008/11/24/simple-dither-effect-using-css/" target="_blank">dither effect using</a> CSS .</li>
</ul>
<h2><span style="TEXT-DECORATION: underline">17. 创建一个类似 liDock 的按钮效果</span></h2>
<h2><img class="aligncenter size-full wp-image-1711" title="css_dock" src="http://www.kooxo.com/uploads/allimg/090328/23075420.jpg" alt="css_dock" width="500" height="155" /></h2>
<ul>
<li><a title="Permanent Link: Horizontal Menus That Grow on You" rel="bookmark" href="http://csshowto.com/menus/horizontal-menus-that-grow-on-you/">Horizontal Menus That Grow on You</a></li>
</ul>
<h2><span style="TEXT-DECORATION: underline">18. CSS 悬停翻转特效</span></h2>
<h2><img class="aligncenter size-full wp-image-1713" title="hover_swap" src="http://www.kooxo.com/uploads/allimg/090328/23075421.jpg" alt="hover_swap" width="500" height="160" /></h2>
<ul>
<li>
<p class="postTitle"><a href="http://min.frexy.com/article/css_swap_hover_effect/" target="_blank">CSS swap hover effect</a></p>
</li>
</ul>
<h2><span style="TEXT-DECORATION: underline">19. CSS实现偏振光滤镜特效</span></h2>
<p style="TEXT-ALIGN: center" align="center"><span style="TEXT-DECORATION: underline"><a href="http://www.kooxo.com/uploads/allimg/090328/23075422.jpg"><img class="aligncenter size-full wp-image-1725" title="polaroid-css" src="http://www.kooxo.com/uploads/allimg/090328/23075422.jpg" alt="polaroid-css" width="500" height="227" /></a></span></p>
<ul class="maglist">
<li>Do you like Polaroid pictures? Well using this <a href="http://www.vasudevaservice.com/blog/archive/2006/10/02/polaroid-effect-using-css-and-rest" target="_blank">technique</a> you can make the pictures on website look like Polaroid.</li>
<li><a href="http://jcornelius.com/articles/polaroidizing-photos-with-css/" target="_blank">Polaroid-izing photos with CSS and one Image.</a></li>
</ul>
<h2><span style="TEXT-DECORATION: underline">20. CSS 实现杂志风格布局</span></h2>
<p align="center"><img class="aligncenter size-full wp-image-1727" title="magazine" src="http://www.kooxo.com/uploads/allimg/090328/23075423.jpg" alt="magazine" width="500" height="314" /></p>
<ul>
<li><a href="http://www.mandarindesign.com/2004/09/magazine-style-css.html" target="_blank">Create a Magazine Type layout Using CSS</a></li>
</ul>
<h2><span style="TEXT-DECORATION: underline">21. CSS 悬停框菜单</span></h2>
<p align="center"><img class="aligncenter size-full wp-image-1731" title="Hoverbox" src="http://www.kooxo.com/uploads/allimg/090328/23075424.jpg" alt="Hoverbox" width="500" height="137" /></p>
<p align="center">A really <a href="http://www.designmeme.com/articles/hoverboxmenu/" target="_blank">cool CSS Menu</a> using Images and CSS</p>
<h2><span style="TEXT-DECORATION: underline">22. 纯CSS 实现Tab 效果 </span></h2>
<p align="center"><span style="TEXT-DECORATION: underline"><img class="aligncenter size-full wp-image-1733" title="css_tab" src="http://www.kooxo.com/uploads/allimg/090328/23075425.jpg" alt="css_tab" width="500" height="202" /></span></p>
<ul>
<li>Using CSS only <a href="http://www.3point7designs.com/blog/2007/09/12/css-tabs-css-only-dom-tabs/" target="_blank">Create a Tabbed content</a>. No jquery or Javascript at all.</li>
</ul>
<h2><span style="TEXT-DECORATION: underline">23.CSS 实现固定的背景</span></h2>
<p align="center"><a href="http://www.askthecssguy.com/examples/fixedBackgroundImages/example01.html" target="_blank"><img class="aligncenter size-full wp-image-1736" title="css_magic" src="http://www.kooxo.com/uploads/allimg/090328/23075426.jpg" alt="css_magic" width="499" height="324" /></a></p>
<ul>
<li>Ask the CSS Guy <a href="http://www.askthecssguy.com/2009/01/mike_asks_the_css_guy_about_a.html" target="_blank">shows a trick that reveals a magic </a>as you scroll.</li>
</ul>
<h2><span style="TEXT-DECORATION: underline">24.CSS提示信息</span></h2>
<p align="center"><img class="aligncenter size-full wp-image-1739" title="tool_tips" src="http://www.kooxo.com/uploads/allimg/090328/23075427.jpg" alt="tool_tips" width="500" height="178" /></p>
<ul>
<li><a href="http://lixlpixel.org/css_tooltip/" target="_blank">Show a message when hovering over the links.</a></li>
</ul>
<h2><span style="TEXT-DECORATION: underline">25. 纯CSS装载图 </span></h2>
<h2><a href="http://www.kooxo.com/uploads/allimg/090328/23075428.jpg"><img class="aligncenter size-full wp-image-1756" title="css_loader" src="http://www.kooxo.com/uploads/allimg/090328/23075428.jpg" alt="css_loader" width="500" height="239" /></a></h2>
<ul>
<li><a href="http://www.dynamixlabs.com/2008/01/17/a-quick-look-add-a-loading-icon-to-your-larger-images/" target="_blank">Add a “loading” icon to your larger images</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/453.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web 设计:实现干净代码的12条定律</title>
		<link>http://www.tisswb.com/archives/210.html</link>
		<comments>http://www.tisswb.com/archives/210.html#comments</comments>
		<pubDate>Sun, 16 Nov 2008 06:09:34 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web技术]]></category>
		<category><![CDATA[Web设计]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=210</guid>
		<description><![CDATA[漂亮的代码是漂亮网站的基础，优秀的 CSS 只存在与同样优秀的 HTML 之上，干净的，语义的 HTML 代码让一个网站更健壮。本文讲述了12个实现干净 Web 设计代码的定律，适合于任何从事 Web 设计的人。
1. Strict DOCTYPE
要做就做对的。不管是 HTML 4.01 还是 XHTML 1.0，它们都提供 Strict 模式，使用 Strict 模式可以保证我们的代码不隐藏任何错误。

参考资料:

W3C: Recommended DTDs to use in your Web document
Fix Your Site With the Right DOCTYPE!
No more Transitional DOCTYPEs, please

<span class="readmore"><a href="http://www.tisswb.com/archives/210.html" title="Web 设计:实现干净代码的12条定律" target="_blank">阅读全文——共1764字</a></span>]]></description>
			<content:encoded><![CDATA[<p>漂亮的代码是漂亮网站的基础，优秀的 CSS 只存在与同样优秀的 HTML 之上，干净的，语义的 HTML 代码让一个网站更健壮。本文讲述了12个实现干净 Web 设计代码的定律，适合于任何从事 Web 设计的人。</p>
<p>1. Strict DOCTYPE<br />
要做就做对的。不管是 HTML 4.01 还是 XHTML 1.0，它们都提供 Strict 模式，使用 Strict 模式可以保证我们的代码不隐藏任何错误。<br />
<img src="http://www.comsharp.com/Writable/Resource/_Random_/2008-11-15/1.gif" alt="" /></p>
<p><strong>参考资料:</strong></p>
<ul>
<li><a href="http://www.w3.org/QA/2002/04/valid-dtd-list.html">W3C: Recommended DTDs to use in your Web document</a></li>
<li><a href="http://www.alistapart.com/stories/doctype/">Fix Your Site With the Right DOCTYPE!</a></li>
<li><a href="http://www.456bereastreet.com/archive/200609/no_more_transitional_doctypes_please/">No more Transitional DOCTYPEs, please</a></li>
</ul>
<p>2. 字符集声明，特殊字符进行编码处理<br />
字符集声明应当放在 &lt;hea&gt; 部分的最前面，以便让浏览器知道如何显示网页中的所有内容，包括标题。另外，一些特殊字符，如 &amp; 最好用 &amp;amp; 代替，这是一种最安全的方法。<br />
<img src="http://www.comsharp.com/Writable/Resource/_Random_/2008-11-15/2.gif" alt="" /></p>
<p><strong>参考资料:</strong></p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/UTF-8">Wikipedia: UTF-8</a></li>
<li><a href="http://www.cs.tut.fi/~jkorpela/chars.html">A tutorial on character code issues</a></li>
<li><a href="http://www.ascii-code.com/">The Extended ASCII table</a></li>
</ul>
<p>3. 恰当的锁进<br />
缩进不会影响网页的渲染，但会明显改善阅读源代码时的体验。缩进没有特定的规则，但始终保持一致是个好习惯。<br />
<img src="http://www.comsharp.com/Writable/Resource/_Random_/2008-11-15/3.gif" alt="" /></p>
<p><strong>参考资料:</strong></p>
<ul>
<li><a href="http://www.w3.org/People/Raggett/tidy/">Clean up your Web pages with HTML TIDY</a></li>
</ul>
<p>4. 将 CSS 和 JavaScript 放在外部文件中<br />
将 CSS 和 JavaScript 放在外部文件中引用，不仅减低单个网页的尺寸，而且意味着其它网页也可以共用这些代码，另外，浏览器的缓存机制可以很好地降低对相同代码的重复下载。<br />
<img src="http://www.comsharp.com/Writable/Resource/_Random_/2008-11-15/4.gif" alt="" /><br />
  5. 正确地嵌套 Tag 标签<br />
如下图，第一行代码中，&lt;h1&gt;标签嵌套在 &lt;a&gt;标签中，尽管多数浏览器会正确渲染，但这不是好的习惯， 标签是 block 对象，而 是 inline 对象，inline 对象不应该容纳 block 对象。</p>
<p><img src="http://www.comsharp.com/Writable/Resource/_Random_/2008-11-15/5.gif" alt="" /><br />
6. 消除不必要的 &lt;div&gt;<br />
&lt;div&gt; 常被滥用（尤其在我们现在所处的 DIV+CSS 神话中 &#8211; 译者），人们希望把任何东西都放在 &lt;div&gt; 中以便为它们分配 CSS 式样，这种滥用会导致的臃肿。<br />
<img src="http://www.comsharp.com/Writable/Resource/_Random_/2008-11-15/6.gif" alt="" /></p>
<p><strong>参考资料:</strong></p>
<ul>
<li><a href="http://csscreator.com/?q=divitis">Divitis: what it is, and how to cure it.</a></li>
</ul>
<p>7. 使用更好的命名规则<br />
如下图，Cat 的 CSS 类被命名为 red italic，暗示着 Cat 使用红色斜体，如果你想将 Cat 改成兰色的粗体呢？<br />
<img src="http://www.comsharp.com/Writable/Resource/_Random_/2008-11-15/7.gif" alt="" /></p>
<p>8. 尽量使用 CSS 控制文字的排版<br />
如下图所示，不要直接使用大写，用 CSS 对这些文字排版方面的格式进行控制，这样会更灵活。<br />
<img src="http://www.comsharp.com/Writable/Resource/_Random_/2008-11-15/8.gif" alt="" /></p>
<p>9. 为 &lt;body&gt; 分配独立的 class/id<br />
为 body Tag 分配一个独立的 class/id，可以很好地定位页面中任何对象，因为页面中所有对象都位于 body 中。<br />
<img src="http://www.comsharp.com/Writable/Resource/_Random_/2008-11-15/9.gif" alt="" /></p>
<p><strong>参考资料:</strong></p>
<ul>
<li><a href="http://css-tricks.com/id-your-body-for-greater-css-control-and-specificity/">ID Your Body For Greater CSS Control and Specificity</a></li>
<li><a href="http://www.37signals.com/svn/archives2/case_study_reusing_styles_with_a_body_class.php">Case study: Re-using styles with a body class</a></li>
</ul>
<p>10. 验证<br />
无需多言，你应当尽可能对网页的代码进行验证，尽管有些代码错误浏览器能自动更正，但有些错误是会带来不好的后果的，尤其当你位于 Strict 模式下。即使什么都不为，看到那个绿色的 W3C 验证标志至少可以让自己舒服一些。</p>
<p>W3C 验证是否通过并不一定要什么拘泥，Web 设计中存在更多的考量，只拘泥 W3C 验证结果，可能影响一些更重要的因素，比如，IE6 在 W3C 标准方面存在不少 BUG，如果你为了100%通过 W3C 验证而宣布自己的网站不支持 IE6，至少在国内会得不偿失的 &#8211; 译者<br />
<img src="http://www.comsharp.com/Writable/Resource/_Random_/2008-11-15/10.gif" alt="" /></p>
<p><strong>参考资料:</strong></p>
<ul>
<li><a href="http://validator.w3.org/">The W3C Markup Validation Service</a></li>
<li><a href="http://xhtml-css.com/">XHTML-CSS Validator</a></li>
<li><a href="http://freesitevalidator.com/">Free Site Validator (checks entire site, not just one page)</a></li>
</ul>
<p>11. 合理的结构次序<br />
将网页结构保持一个合乎逻辑的次序。<br />
<img src="http://www.comsharp.com/Writable/Resource/_Random_/2008-11-15/11.gif" alt="" /><br />
12. 尽你所能<br />
如果你从零开始写，保持以上的原则当然要容易的多，如果要修改旧的代码，将会很痛苦，一些 CMS 系统拙劣的编码会让你陷入泥沼，或者你的网站规模宏大要改动的东西太多，不管怎样，始终保持良好的习惯非常重要。<br />
<img src="http://www.comsharp.com/Writable/Resource/_Random_/2008-11-15/12.gif" alt="" /></p>
<p><strong>更多阅读：</strong></p>
<ul>
<li>
<div class="showcase"><a href="http://www.comsharp.com/GetKnowledge/zh-CN/101WebRulesOverView.aspx">完美网站的101项指标</a></div>
</li>
</ul>
<p>本文国际来源：<a href="http://www.smashingmagazine.com/2008/11/12/12-principles-for-keeping-your-code-clean/">http://www.smashingmagazine.com/2008/11/12/12-principles-for-keeping-your-code-clean/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/210.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>div之float,clear特性</title>
		<link>http://www.tisswb.com/archives/76.html</link>
		<comments>http://www.tisswb.com/archives/76.html#comments</comments>
		<pubDate>Wed, 25 Jun 2008 06:10:29 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web技术]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=76</guid>
		<description><![CDATA[在写HTML代码的时候，发现在Firefox等符合W3C标准的浏览器中，如果有一个DIV作为外部容器，内部的DIV如果设置了float样式，则外部的容器DIV因为内部没有clear，导致不能被撑开。看下面的例子：
HTML4STRICT代码：



&#60;div style=&#8220;width:200px;border:1px solid red;&#8221;&#62;


    &#60;div style=&#8220;float:left;width:80px;height:80px;border:1px solid blue;&#8221;&#62;TEST DIV&#60;/div&#62;

<span class="readmore"><a href="http://www.tisswb.com/archives/76.html" title="div之float,clear特性" target="_blank">阅读全文——共2898字</a></span>]]></description>
			<content:encoded><![CDATA[<p>在写HTML代码的时候，发现在Firefox等符合W3C标准的浏览器中，如果有一个DIV作为外部容器，内部的DIV如果设置了float样式，则外部的容器DIV因为内部没有clear，导致不能被撑开。看下面的例子：</p>
<p>HTML4STRICT代码：</p>
<div class="codebox">
<ol>
<li class="li1">
<div class="de1"><span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">style</span>=<span class="st0">&#8220;width:200px;border:1px solid red;&#8221;</span><span class="kw2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">    <span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">style</span>=<span class="st0">&#8220;float:left;width:80px;height:80px;border:1px solid blue;&#8221;</span><span class="kw2">&gt;</span></span>TEST DIV<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">    <span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">style</span>=<span class="st0">&#8220;float:left;width:80px;height:80px;border:1px solid blue;&#8221;</span><span class="kw2">&gt;</span></span>TEST DIV<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">    <span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">style</span>=<span class="st0">&#8220;float:left;width:80px;height:80px;border:1px solid blue;&#8221;</span><span class="kw2">&gt;</span></span>TEST DIV<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</li>
<li class="li2">
<div class="de2">    <span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">style</span>=<span class="st0">&#8220;float:left;width:80px;height:80px;border:1px solid blue;&#8221;</span><span class="kw2">&gt;</span></span>TEST DIV<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">    <span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">style</span>=<span class="st0">&#8220;float:left;width:80px;height:80px;border:1px solid blue;&#8221;</span><span class="kw2">&gt;</span></span>TEST DIV<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</li>
</ol>
</div>
<p>显示的结果如下：</p>
<div><img src="http://nps.osall.com/upload/1/Images/1_1158418578/P_1160709253_0.gif" alt="P_1160709253_0.gif" width="209" height="254" /><br />
<span style="color: #330000;">容器DIV没有被撑开</span>
</div>
<p>大家可以看到，作为外部容器的边框为红色的DIV，没有被撑开。这是因为内部的DIV因为float:left之后，就丢失了clear:both和display:block的样式，所以外部的DIV不会被撑开。<br />
我们想让外部容器的DIV随着内部DIV增多而增加高度，要怎么解决呢？</p>
<p>以前我都是用这样的方法来解决：<br />
HTML4STRICT代码：</p>
<div class="codebox">
<ol>
<li class="li1">
<div class="de1"><span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">style</span>=<span class="st0">&#8220;width:200px;border:1px solid red;&#8221;</span><span class="kw2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">    <span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">style</span>=<span class="st0">&#8220;float:left;width:80px;height:80px;border:1px solid blue;&#8221;</span><span class="kw2">&gt;</span></span>TEST DIV<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">    <span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">style</span>=<span class="st0">&#8220;float:left;width:80px;height:80px;border:1px solid blue;&#8221;</span><span class="kw2">&gt;</span></span>TEST DIV<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">    <span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">style</span>=<span class="st0">&#8220;float:left;width:80px;height:80px;border:1px solid blue;&#8221;</span><span class="kw2">&gt;</span></span>TEST DIV<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</li>
<li class="li2">
<div class="de2">    <span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">style</span>=<span class="st0">&#8220;float:left;width:80px;height:80px;border:1px solid blue;&#8221;</span><span class="kw2">&gt;</span></span>TEST DIV<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">    <span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">style</span>=<span class="st0">&#8220;float:left;width:80px;height:80px;border:1px solid blue;&#8221;</span><span class="kw2">&gt;</span></span>TEST DIV<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">    <span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">style</span>=<span class="st0">&#8220;clear:both;&#8221;</span><span class="kw2">&gt;</span></span><span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</li>
</ol>
</div>
<p>显示的结果如下：</p>
<div><img src="http://nps.osall.com/upload/1/Images/1_1158418578/P_1160709321_0.gif" alt="P_1160709321_0.gif" width="207" height="248" /><br />
<span style="color: #330000;">显示正常了</span>
</div>
<p>我们看到，在容器DIV内要显示出来的float:left的所有的DIV之后，我们添加了这样的一个DIV：<span style="color: #000000; font-family: Courier New, monospace; background-color: #ffffcc;">&lt;div style=&#8221;clear:both&#8221;&gt;&lt;/div&gt;</span>    。这样，其实就在最后增加了clear的动作。</p>
<p>但是，我总觉得，这么多加一个DIV有点不妥。一是多了一个没有意义的DIV，二是在用dojo做Drag &amp; Drop的时候，由于这个DIV是容器DIV的一个字节点，如果这个节点被移动，则会造成排版上的Bug：如果要显示的蓝框的DIV被移到这个DIV之后，则因为clear:both，它会被强制换一行显示。所以，我一直在寻找更好的解决办法。</p>
<p>昨天在无数次的询问了Google大仙后，我终于找到了<strong><em>How To Clear Floats Without Structural Markup</em></strong> 这篇文章，找到了解决的办法。</p>
<p>首先设置这样的CSS：<br />
CSS代码：</p>
<div class="codebox">
<ol>
<li class="li1">
<div class="de1">.clearfix<span class="re2">:after </span><span class="br0">{</span></div>
</li>
<li class="li1">
<div class="de1">    <span class="kw1">content</span>: <span class="st0">&#8220;.&#8221;</span>;</div>
</li>
<li class="li1">
<div class="de1">    <span class="kw1">display</span>: <span class="kw2">block</span>;</div>
</li>
<li class="li1">
<div class="de1">    <span class="kw1">height</span>: <span class="nu0">0</span>;</div>
</li>
<li class="li2">
<div class="de2">    <span class="kw1">clear</span>: <span class="kw2">both</span>;</div>
</li>
<li class="li1">
<div class="de1">    <span class="kw1">visibility</span>: <span class="kw2">hidden</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">}</span></div>
</li>
</ol>
</div>
<p>然后，我们再修改原来的HTML代码，让外部的容器DIV来使用这个CSS：<br />
HTML4STRICT代码：</p>
<div class="codebox">
<ol>
<li class="li1">
<div class="de1"><span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">style</span>=<span class="st0">&#8220;width:200px;border:1px solid red;&#8221;</span> <span class="kw3">class</span>=<span class="st0">&#8220;clearfix&#8221;</span><span class="kw2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">    <span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">style</span>=<span class="st0">&#8220;float:left;width:80px;height:80px;border:1px solid blue;&#8221;</span><span class="kw2">&gt;</span></span>TEST DIV<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">    <span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">style</span>=<span class="st0">&#8220;float:left;width:80px;height:80px;border:1px solid blue;&#8221;</span><span class="kw2">&gt;</span></span>TEST DIV<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">    <span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">style</span>=<span class="st0">&#8220;float:left;width:80px;height:80px;border:1px solid blue;&#8221;</span><span class="kw2">&gt;</span></span>TEST DIV<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</li>
<li class="li2">
<div class="de2">    <span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">style</span>=<span class="st0">&#8220;float:left;width:80px;height:80px;border:1px solid blue;&#8221;</span><span class="kw2">&gt;</span></span>TEST DIV<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">    <span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">style</span>=<span class="st0">&#8220;float:left;width:80px;height:80px;border:1px solid blue;&#8221;</span><span class="kw2">&gt;</span></span>TEST DIV<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</li>
</ol>
</div>
<p>在Firefox里测试一下，哈哈，这样做的确很有效，显示正常，而且dojo的 Drag &amp; Drop 也不会有问题了。原来，这个clearfix的CSS使用了after这个伪对象，它将在应用clearfix的元素的结尾添加content中的内容。在这里添加了一个句号&#8221;.&#8221;，并且把它的display设置成block；高度设为0；clear设为both；visibility设为隐藏。这样就达到了撑开容器的目的啦。</p>
<p>但是，在文章中说，Windows IE并不支持这样做。所以要让IE也完美显示，则必须在clearfix这个CSS定义的后面加上一些专门为IE设定的HACK。CSS如下：<br />
CSS代码：</p>
<div class="codebox">
<ol>
<li class="li1">
<div class="de1">.clearfix<span class="re2">:after </span><span class="br0">{</span></div>
</li>
<li class="li1">
<div class="de1">    <span class="kw1">content</span>: <span class="st0">&#8220;.&#8221;</span>;</div>
</li>
<li class="li1">
<div class="de1">    <span class="kw1">display</span>: <span class="kw2">block</span>;</div>
</li>
<li class="li1">
<div class="de1">    <span class="kw1">height</span>: <span class="nu0">0</span>;</div>
</li>
<li class="li2">
<div class="de2">    <span class="kw1">clear</span>: <span class="kw2">both</span>;</div>
</li>
<li class="li1">
<div class="de1">    <span class="kw1">visibility</span>: <span class="kw2">hidden</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">}</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">/* Hides from IE-mac */</span></div>
</li>
<li class="li1">
<div class="de1">* html <span class="re1">.clearfix </span><span class="br0">{</span><span class="kw1">height</span>: <span class="nu0">1</span>%;<span class="br0">}</span></div>
</li>
<li class="li2">
<div class="de2"><span class="coMULTI">/* End hide from IE-mac */</span></div>
</li>
</ol>
</div>
<p>因为转义字符&#8221;"，Mac IE浏览器会忽略掉这段Hack，但Windows IE不会，它会应用 <span style="color: #000000; font-family: Courier New, monospace; background-color: #ffffcc;">* html .clearfix {height: 1%;}</span> 来达到撑开DIV容器的目的（貌似Mac IE没有办法解决这个问题，不过幸好用户数量是在是太少了，Safari支持就可以了:p）。</p>
<p>测试一下，果然大功告成。</p>
<div><img src="http://nps.osall.com/upload/1/Images/1_1158418578/P_1160709321_0.gif" alt="P_1160709321_0.gif" width="207" height="248" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/76.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>div+css常用到的全局css定义</title>
		<link>http://www.tisswb.com/archives/58.html</link>
		<comments>http://www.tisswb.com/archives/58.html#comments</comments>
		<pubDate>Fri, 30 May 2008 01:43:57 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web技术]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=58</guid>
		<description><![CDATA[每一个用css控制的网站，都需要有一个默认的全局定义的css样式，今天写了一份，以后作为默认的使用，具体细节需要略微调整，这样可以省很多事。
具体代码如下：
body { font-family:&#8221;宋体&#8221;; margin:0; padding:0; background: #FFFFFF; font-size:12px; color:#000000;}
a:link {color: #000099; text-decoration:none;}
a:visited { color: #000099; text-decoration:none;}
a:hover{ color:#FF0000;text-decoration:underline;}
div,form,img,ul,ol,li,dl,dt,dd,p { margin: 0; padding: 0; border: 0;}
<span class="readmore"><a href="http://www.tisswb.com/archives/58.html" title="div+css常用到的全局css定义" target="_blank">阅读全文——共1128字</a></span>]]></description>
			<content:encoded><![CDATA[<p>每一个用css控制的网站，都需要有一个默认的全局定义的css样式，今天写了一份，以后作为默认的使用，具体细节需要略微调整，这样可以省很多事。</p>
<p>具体代码如下：</p>
<blockquote><p>body { font-family:&#8221;宋体&#8221;; margin:0; padding:0; background: #FFFFFF; font-size:12px; color:#000000;}<br />
a:link {color: #000099; text-decoration:none;}<br />
a:visited { color: #000099; text-decoration:none;}<br />
a:hover{ color:#FF0000;text-decoration:underline;}<br />
div,form,img,ul,ol,li,dl,dt,dd,p { margin: 0; padding: 0; border: 0;}<br />
li{ list-style:none;}<br />
h1,h2,h3,h4,h5,h6,input { margin:0; padding:0;}<br />
table,td,tr,th{ font-size:12px;}<br />
h2{ font-family:&#8221;宋体&#8221;; font-size:12px; color: #1e629e; line-height:24px; text-decoration:none;}<br />
h2 a:link{ color:#c00505; text-decoration:underline;}<br />
h2 a:visited{ color:#c00505; text-decoration:underline;}<br />
h2 a:hover{ color:#540808; text-decoration:none;}</p>
<p>h3{ line-height:20px; font-size:14px;}<br />
h4{font-family:&#8221;宋体&#8221;; font-size:14px; color: #266591; font-weight:bolder; padding-left:6px; padding-top:6px;}<br />
.spaceline{clear:both; line-height:5px; height:5px; margin:0 auto}</p>
<p>.clear{ clear: both; font-size:1px; width:1px; visibility: hidden; }<br />
#width{width:950px;margin:3px auto 0 auto;padding:0;text-align:left;}<br />
#width950{width:950px;margin:3px auto 0 auto;padding:0;text-align:left;}</p></blockquote>
<p>其中的各种颜色需要根据网站的整体色调调整，其他部分也有些细节调整。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/58.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决调试CSS布局IE6,IE7,Firefox下不兼容的方法</title>
		<link>http://www.tisswb.com/archives/57.html</link>
		<comments>http://www.tisswb.com/archives/57.html#comments</comments>
		<pubDate>Thu, 29 May 2008 06:48:46 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web技术]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=57</guid>
		<description><![CDATA[解决IE6,IE7,Firefox下调时css不兼容的问题大致有两种方法，今天测试了一下，感觉不错。以下两种方法几乎能解决现今所有HACK.
1, !important
随着IE7对!important的支持, !important 方法现在只针对IE6的HACK.(注意写法.记得该声明位置需要提前.)
&#60;style&#62;
#wrapper
{
width: 100px!important; /* IE7+FF */
width: 80px; /* IE6 */
}
&#60;/style&#62;
<span class="readmore"><a href="http://www.tisswb.com/archives/57.html" title="解决调试CSS布局IE6,IE7,Firefox下不兼容的方法" target="_blank">阅读全文——共765字</a></span>]]></description>
			<content:encoded><![CDATA[<p>解决IE6,IE7,Firefox下调时css不兼容的问题大致有两种方法，今天测试了一下，感觉不错。以下两种方法几乎能解决现今所有HACK.</p>
<p><strong>1, !important</strong></p>
<p>随着IE7对!important的支持, !important 方法现在只针对IE6的HACK.(注意写法.记得该声明位置需要提前.)</p>
<p>&lt;style&gt;<br />
#wrapper<br />
{<br />
width: 100px!important; /* IE7+FF */<br />
width: 80px; /* IE6 */<br />
}<br />
&lt;/style&gt;</p>
<p><strong>2, IE6/IE77对FireFox</strong></p>
<p>*+html 与 *html 是IE特有的标签, firefox 暂不支持.而*+html 又为IE7特有标签.</p>
<p>&lt;style&gt;<br />
#wrapper<br />
{<br />
#wrapper { width: 120px; } /* FireFox */<br />
*html #wrapper { width: 80px;} /* ie6 fixed */<br />
*+html #wrapper { width: 60px;} /* ie7 fixed, 注意顺序 */<br />
}<br />
&lt;/style&gt;</p>
<p>下面分别给出IE6IE7Firefox的hack代码：</p>
<p>#example { color: #333; }      /* Firefox */* html<br />
#example { color: #666; }      /* IE6 */*+html<br />
#example { color: #999; }      /* IE7 */<br />
那么在Firefox下字体颜色显示为#333，IE6下字体颜色显示为#666，IE7下字体颜色显示为#999，他们之间互不干扰。</p>
<p><strong>注意:<br />
</strong>*+html 对IE7的HACK 必须保证HTML顶部有如下声明：<br />
&lt;!DOCTYPE HTML PUBLIC &#8220;-//W3C//DTD HTML 4.01 Transitional//EN&#8221;　&#8221;<a href="http://www.w3.org/TR/html4/loose.dtd"><span style="color: #22148d;">http://www.w3.org/TR/html4/loose.dtd</span></a>&#8220;&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/57.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10个用能用JavaScript实现的图片特效</title>
		<link>http://www.tisswb.com/archives/35.html</link>
		<comments>http://www.tisswb.com/archives/35.html#comments</comments>
		<pubDate>Sun, 04 May 2008 16:12:27 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web技术]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[图片特效]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=35</guid>
		<description><![CDATA[一般来说，我们在写博客或做网站时都需要对插图做一些效果，比如增加阴影、图片圆角、倒映等等。这些效果一般可以用3个方法实现，一是用PS实现对图片进行修改，二是使用CSS，三是使用JavaScript。使用PS会破坏原图，而且要花费一定的时间。Netzgesta上有很多实现图片特效的JavaScript提供下载，很多效果都是相当漂亮的。
1、水倒映

这个js将为图片添加水倒映的特效，时下web2.0站点很喜欢这种效果。
如果你喜欢在线生成水倒映效果，可以参考这里。
js下载链接
2、圆角+阴影

或许你记得用RoundPic能在线生成圆角图片，事实上用这个js也可以实现效果。
js下载链接
<span class="readmore"><a href="http://www.tisswb.com/archives/35.html" title="10个用能用JavaScript实现的图片特效" target="_blank">阅读全文——共908字</a></span>]]></description>
			<content:encoded><![CDATA[<p>一般来说，我们在写博客或做网站时都需要对插图做一些效果，比如增加阴影、图片圆角、倒映等等。这些效果一般可以用3个方法实现，一是用PS实现对图片进行修改，二是使用CSS，三是使用JavaScript。使用PS会破坏原图，而且要花费一定的时间。<a href="http://www.netzgesta.de/">Netzgesta</a>上有很多实现图片特效的JavaScript提供下载，很多效果都是相当漂亮的。</p>
<p><strong>1、水倒映</strong></p>
<p><a href="http://www.kenengba.com/post/432.html"><img src="http://lh5.ggpht.com/wangyanan1981/SBUsNQ9qlrI/AAAAAAAAAJQ/gDRoS8yxWhI/s800/reflex.gif" border="0" alt="10个用能用JavaScript实现的图片特效（可能吧 www.kenengba.com）" /></a></p>
<p>这个js将为图片添加水倒映的特效，时下<a href="http://www.kenengba.com/post/382.html">web2.0</a>站点很喜欢这种效果。</p>
<p>如果你喜欢在线生成水倒映效果，可以参考<a href="http://www.kenengba.com/post/341.html">这里</a>。</p>
<p><a href="http://www.netzgesta.de/reflex/">js下载链接</a></p>
<p><strong>2、圆角+阴影</strong></p>
<p><img src="http://lh5.ggpht.com/wangyanan1981/SBUsNQ9qltI/AAAAAAAAAJg/38zm7VyaP0E/s800/corner.jpg" alt="" /></p>
<p>或许你记得用<a href="http://www.kenengba.com/post/338.html">RoundPic</a>能在线生成圆角图片，事实上用这个js也可以实现效果。</p>
<p><a href="http://www.netzgesta.de/corner/">js下载链接</a></p>
<p><strong>3、高光圆角阴影</strong></p>
<p><a href="http://www.kenengba.com/post/432.html"><img src="http://lh6.ggpht.com/wangyanan1981/SBUsSg9qlwI/AAAAAAAAAJ4/4cqPTK8_yHE/s800/glossy.jpg" border="0" alt="10个用能用JavaScript实现的图片特效（可能吧 www.kenengba.com）" /></a></p>
<p>这个效果可以用来做按钮。是我最喜欢的特效之一。</p>
<p><a href="http://www.netzgesta.de/glossy/">js下载链接</a></p>
<p><strong>4、斜光阴影效果</strong></p>
<p><img src="http://lh5.ggpht.com/wangyanan1981/SBUsNQ9qlsI/AAAAAAAAAJY/HvdKWsdjtYQ/s800/bevel.jpg" alt="" /></p>
<p>和上面的效果看起来非常相似，但也有不同的地方。</p>
<p><a href="http://www.netzgesta.de/bevel/">js下载链接</a></p>
<p><strong>5、相框效果</strong></p>
<p><a href="http://www.kenengba.com/"><img src="http://lh3.ggpht.com/wangyanan1981/SBUsSw9qlxI/AAAAAAAAAKA/xejKU3wrOFI/s800/instant.jpg" border="0" alt="10个用能用JavaScript实现的图片特效（可能吧 www.kenengba.com）" /></a></p>
<p>如果你在做图片博客，可以你会喜欢这个js，使用后博客文章内的图片都有相框的效果。</p>
<p><a href="http://instant.netzgesta.de/">js下载链接</a></p>
<p><strong>6、黑色相框</strong></p>
<p><img src="http://lh6.ggpht.com/wangyanan1981/SBUsTg9qlzI/AAAAAAAAAKQ/zydY1gpgew0/s800/slided.jpg" alt="" /></p>
<p>不喜欢白色没有立体感的相框，那试试这个立体感充足的js效果吧。</p>
<p><a href="http://slided.netzgesta.de/">js下载链接</a></p>
<p><strong>7、放大镜</strong></p>
<p><a href="http://www.kenengba.com/"><img src="http://lh4.ggpht.com/wangyanan1981/SBUsTA9qlyI/AAAAAAAAAKI/h6do4Yb7L8g/s800/loupe.jpg" border="0" alt="10个用能用JavaScript实现的图片特效（可能吧 www.kenengba.com）" /></a></p>
<p>一个很有趣的js，实现放大镜效果。记得在去年Google开发者日的时候，某个主讲人也有说到在GMaps里实现放大镜的有趣效果。具体效果<a href="http://code.google.com/intl/zh-CN/apis/maps/documentation/demos/magnifier/magnifier.html">点击这里</a>。</p>
<p><a href="http://www.netzgesta.de/loupe/">js下载链接</a></p>
<p><strong>8、菲林效果</strong></p>
<p><img src="http://lh4.ggpht.com/wangyanan1981/SBUsSA9qlvI/AAAAAAAAAJw/BPthH6MPIlY/s800/filmed.jpg" alt="" /></p>
<p>如果你在写一个电影博客，这个效果或许会让你喜欢。</p>
<p><a href="http://www.netzgesta.de/filmed/">js下载链接</a></p>
<p><strong>9、花边效果</strong></p>
<p><img src="http://lh6.ggpht.com/wangyanan1981/SBUsNg9qluI/AAAAAAAAAJo/RrnvDiKa1j8/s800/edge.jpg" alt="" /></p>
<p>很简单的图片花边效果。</p>
<p><a href="http://www.netzgesta.de/edge/">js下载链接</a></p>
<p><strong>10、翻页效果</strong></p>
<p><a href="http://www.kenengba.com/post/432.html"><img src="http://lh5.ggpht.com/wangyanan1981/SBUsNQ9qlqI/AAAAAAAAAJI/ryYkt-zPl5A/s800/curl.jpg" border="0" alt="10个用能用JavaScript实现的图片特效（可能吧 www.kenengba.com）" /></a></p>
<p>翻页效果是很常见的，Google一下你会发现有很多相关的教程，如果你不想花时间去学，直接下载这个js吧。</p>
<p><a href="http://www.netzgesta.de/curl/">js下载链接</a></p>
<p><strong><span style="font-size: medium; color: #ff6600;"><span style="text-decoration: underline;">安装使用方法：</span></span></strong></p>
<p>将下载的压缩包解压之后上传到网站空间，然后在需要显示效果的head里添加代码，比如高光阴影效果Glossy，添加的代码是：</p>
<blockquote style="margin-right: 0px;" dir="ltr"><p><span class="Code">&lt;script type=”text/javascript” src=”glossy.js”&gt;&lt;/script&gt; </span></p></blockquote>
<p>对于<a href="http://www.kenengba.com/index.php?tag=wp">WordPress</a>，可以在header.php里添加。如果只要求文章页里出现效果，也可以考虑在single.php里添加。</p>
<p>然后，在想要显示特效的图片的&lt;img&gt;标记里添加：</p>
<blockquote style="margin-right: 0px;" dir="ltr"><p>class=”glossy”</p></blockquote>
<p>这样效果就出现了。</p>
<p>其它效果添加方法类似。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/35.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>让并排的两个Div自适应高度（一样高）</title>
		<link>http://www.tisswb.com/archives/28.html</link>
		<comments>http://www.tisswb.com/archives/28.html#comments</comments>
		<pubDate>Thu, 03 Apr 2008 17:24:17 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web技术]]></category>
		<category><![CDATA[div]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=28</guid>
		<description><![CDATA[    由于设计页面需要，要把两个并排显示的div实现一样高的效果，n行n列布局，每列高度（事先并不能确定哪列的高度）的相同，是每个设计师追求的目标。方法有以下几种：1、JS实现（判断2个div高）；2、纯css方法；3、加背景图片实现。首先说下本博客实现的2个div一样高的方法（即js方法）。
 
    div+css基本布局：
 
&#60;div id=&#8221;mm&#8221;&#62;
&#60;div id=&#8221;mm1&#8243;&#62;&#60;/div&#62;
&#60;div id=&#8221;mm2&#8243;&#62;&#60;/div&#62;
&#60;/div&#62;
 
    1、js实现div自适应高度
<span class="readmore"><a href="http://www.tisswb.com/archives/28.html" title="让并排的两个Div自适应高度（一样高）" target="_blank">阅读全文——共1539字</a></span>]]></description>
			<content:encoded><![CDATA[<p>    由于设计页面需要，要把两个并排显示的div实现一样高的效果，n行n列布局，每列高度（事先并不能确定哪列的高度）的相同，是每个设计师追求的目标。方法有以下几种：1、JS实现（判断2个div高）；2、纯css方法；3、加背景图片实现。首先说下本博客实现的2个div一样高的方法（即js方法）。</p>
<p> </p>
<p>    div+css基本布局：</p>
<p> </p>
<p>&lt;div id=&#8221;mm&#8221;&gt;<br />
&lt;div id=&#8221;mm1&#8243;&gt;&lt;/div&gt;<br />
&lt;div id=&#8221;mm2&#8243;&gt;&lt;/div&gt;<br />
&lt;/div&gt;</p>
<p> </p>
<p>    <strong>1、js实现div自适应高度</strong></p>
<p> </p>
<p>代码如下：<br />
&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
&lt;!&#8211;<br />
window.onload=window.onresize=function(){<br />
if(document.getElementById(&#8220;mm2&#8243;).clientHeight&lt;document.getElementById(&#8220;mm1&#8243;).clientHeight){<br />
document.getElementById(&#8220;mm2&#8243;).style.height=document.getElementById(&#8220;mm1&#8243;).offsetHeight+&#8221;px&#8221;;<br />
}<br />
else{<br />
document.getElementById(&#8220;mm1&#8243;).style.height=document.getElementById(&#8220;mm2&#8243;).offsetHeight+&#8221;px&#8221;;<br />
}<br />
}<br />
&#8211;&gt;<br />
&lt;/script&gt;</p>
<p> </p>
<p>    （注：网上公布了不少方法，但代码或多或少有错；上面的是无错代码；我测试在IE6.0/IE7.0下通过，考虑绝大数人仍然用的是IE，所以并没有在opera和firefoxs下调试，哪位用的是opera或ff，可以帮忙看看。）</p>
<p> </p>
<p>    <strong>2、纯CSS方法</strong></p>
<p> </p>
<p>    css里代码（调试通过，但不会显示div下边框，即border-bottom）：</p>
<p> </p>
<p>/*左右自适应相同高度start*/<br />
#m1,#m2<br />
{<br />
padding-bottom: 32767px !important;<br />
margin-bottom: -32767px !important; <br />
}<br />
@media all and (min-width: 0px) {<br />
#m1,#m2<br />
{<br />
padding-bottom: 0 !important;<br />
margin-bottom: 0 !important; <br />
}<br />
#m1:before, #m2:before<br />
{<br />
content: &#8217;[DO NOT LEAVE IT IS NOT REAL]&#8216;;<br />
display: block;<br />
background: inherit;<br />
padding-top: 32767px !important;<br />
margin-bottom: -32767px !important;<br />
height: 0;<br />
}<br />
}<br />
/*左右自适应相同高度end*/</p>
<p> <br />
    <strong>3、加背景图片</strong></p>
<p> </p>
<p>    这个方法，很多大网站在使用，如163，sina等。</p>
<p> </p>
<p>    XHTML代码：</p>
<p> </p>
<p>&lt;div id=&#8221;wrap&#8221;&gt;<br />
&lt;div id=&#8221;column1&#8243;&gt;这是第一列&lt;/div&gt;<br />
&lt;div id=&#8221;column1&#8243;&gt;这是第二列&lt;/div&gt;<br />
&lt;div class=&#8221;clear&#8221;&gt;&lt;/div&gt;<br />
&lt;/div&gt;</p>
<p> </p>
<p>    CSS代码:</p>
<p> </p>
<p>#wrap{ width:776px; background:url(bg.gif) repeat-y 300px;}<br />
#column1{ float:left; width:300px;}<br />
#column2{ float:right; width:476px;}<br />
.clear{ clear:both;}</p>
<p> </p>
<p>     还有其他的一些方法，但主流就是这几种了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/28.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>无js实现div+css左右高度自适应</title>
		<link>http://www.tisswb.com/archives/27.html</link>
		<comments>http://www.tisswb.com/archives/27.html#comments</comments>
		<pubDate>Thu, 03 Apr 2008 06:17:02 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web技术]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[div]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=27</guid>
		<description><![CDATA[以下代码实现了无js实现div+css左右高度自适应，具体应用视情况而定。
&#60;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8220;&#62;
&#60;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8220;&#62;
&#60;head&#62;
&#60;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=gb2312&#8243; /&#62;
&#60;title&#62;左右自适应高度&#60;/title&#62;
<span class="readmore"><a href="http://www.tisswb.com/archives/27.html" title="无js实现div+css左右高度自适应" target="_blank">阅读全文——共777字</a></span>]]></description>
			<content:encoded><![CDATA[<p>以下代码实现了无js实现div+css左右高度自适应，具体应用视情况而定。</p>
<p>&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>&#8220;&gt;<br />
&lt;html xmlns=&#8221;<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>&#8220;&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=gb2312&#8243; /&gt;<br />
&lt;title&gt;左右自适应高度&lt;/title&gt;<br />
&lt;style type=&#8221;text/css&#8221;&gt;<br />
.outer{display:table}<br />
.outer,.inner,.a,.b{<br />
width:200px;<br />
}<br />
.outer{<br />
margin:10px 0 10px 200px;<br />
background:red;<br />
color:#fff;<br />
}<br />
.inner{<br />
position:relative;<br />
float:left;<br />
margin-left:-200px;<br />
background:blue;<br />
}<br />
.a{<br />
float:left;<br />
}<br />
.b{<br />
position:relative;<br />
float:right;<br />
margin-right:-200px;<br />
}<br />
&lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;div class=&#8221;outer&#8221;&gt;<br />
   &lt;div class=&#8221;inner&#8221;&gt;<br />
     &lt;div class=&#8221;a&#8221;&gt;一边底&lt;/div&gt;<br />
     &lt;div class=&#8221;b&#8221;&gt;另一边高&lt;br /&gt;<br />
       &lt;br /&gt;<br />
       &lt;br /&gt;<br />
       &lt;br /&gt;<br />
       . 这个是另一边高,一边底,这样一边底就能自适应另一边的高度了。&lt;/div&gt;<br />
   &lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/27.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

