<?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>IInterest &#187; IE</title>
	<atom:link href="http://www.iinterest.net/tag/ie/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iinterest.net</link>
	<description>Design &#38; Develope 关注用户体验,追求以用户为中心的设计.</description>
	<lastBuildDate>Thu, 26 Aug 2010 15:17:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>IE6下实现png图片半透明的常用方法</title>
		<link>http://www.iinterest.net/2009/11/13/transparent-png-in-ie6/</link>
		<comments>http://www.iinterest.net/2009/11/13/transparent-png-in-ie6/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 09:57:21 +0000</pubDate>
		<dc:creator>Bell</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[png透明]]></category>

		<guid isPermaLink="false">http://www.iinterest.net/?p=585</guid>
		<description><![CDATA[IE6是个&#8221;神奇&#8221;的浏览器,其原因想必做前端的同行们都深有体会,:)作为我个人而言,最反感的就是IE6不支持除A以外的hover伪类,再一个就是它不支持png图片的alpha透明度.当然此类问题已有众多的解决方案,这里只是总结下自己常用的IE6下实现png半透明的方法以及适用环境. 1.使用滤镜,适用于单一png背景图片的快速部署;弊端:消耗资源比较多,方法比较繁琐. &#60;!DOCTYPE html&#62; &#60;html&#62; &#60;head&#62; &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=utf-8&#34; /&#62; &#60;title&#62;ie6下png透明-iinterest&#60;/title&#62; &#60;style type=&#34;text/css&#34;&#62; *{margin:0; padding:0;} .box{ width:958px; height:512px; background:url(http://image215.poco.cn/mypoco/myphoto/20091114/16/51737245200911141635177073974043057_000.jpg) no-repeat; } .png-bg{width:341px; height:258px; margin:60px auto 0; background:url(http://www.iinterest.net/wp-content/uploads/2009/11/windows.png) no-repeat; _filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://www.iinterest.net/wp-content/uploads/2009/11/windows.png'); _background-image:none; } &#60;/style&#62; &#60;/head&#62; &#60;body&#62; &#60;div class=&#34;box&#34;&#62; &#60;div class=&#34;png-bg&#34;&#62;&#60;/div&#62; &#8230; <a href="http://www.iinterest.net/2009/11/13/transparent-png-in-ie6/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>IE6是个&#8221;神奇&#8221;的浏览器,其原因想必做前端的同行们都深有体会,:)作为我个人而言,最反感的就是IE6不支持除A以外的hover伪类,再一个就是它不支持png图片的alpha透明度.当然此类问题已有众多的解决方案,这里只是总结下自己常用的IE6下实现png半透明的方法以及适用环境.</p>
<p>1.使用滤镜,适用于单一png背景图片的快速部署;弊端:消耗资源比较多,方法比较繁琐.</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_xNwVfQ">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;ie6下png透明-iinterest&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
*{margin:0; padding:0;}
.box{ width:958px; height:512px; background:url(http://image215.poco.cn/mypoco/myphoto/20091114/16/51737245200911141635177073974043057_000.jpg) no-repeat;  }
.png-bg{width:341px; height:258px; margin:60px auto 0; background:url(http://www.iinterest.net/wp-content/uploads/2009/11/windows.png) no-repeat; _filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://www.iinterest.net/wp-content/uploads/2009/11/windows.png'); _background-image:none; }
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;box&quot;&gt;
    &lt;div class=&quot;png-bg&quot;&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_xNwVfQ');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_xNwVfQ');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>2.使用JS(pngfix.js),适用于插入png图片的部署;弊端:pngfix.js会影响到CSS的布局,如demo中img设置了margin,但在浏览时却无效,而且资源消耗较大.<br />
<span id="more-585"></span></p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_TE1Paj">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;ie6下png透明-iinterest&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
*{margin:0; padding:0;}
.box{ width:958px; height:512px; background:url(http://image215.poco.cn/mypoco/myphoto/20091114/16/51737245200911141635177073974043057_000.jpg) no-repeat;}
	img{ margin:30px 0 0 100px; }
&lt;/style&gt;
&lt;script src=&quot;http://www.iinterest.net/demo/js/pngfix.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;box&quot;&gt;
    &lt;img src=&quot;http://www.iinterest.net/wp-content/uploads/2009/11/windows.png&quot; alt=&quot;&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_TE1Paj');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_TE1Paj');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p><a href="http://www.iinterest.net/demo/js/pngfix.js" target="_blank">dome中iepng.js下载</a></p>
<p>3.使用JS(iepng.js),背景图片和插入图片通杀,并可自定义需要png透明效果的容器,适用于复杂的布局环境;弊端:还是资源消耗问题&#8230;</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_7J7X1n">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;ie6下png透明-iinterest&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
*{margin:0; padding:0;}
.box{ width:958px; height:512px; background:url(http://image215.poco.cn/mypoco/myphoto/20091114/16/51737245200911141635177073974043057_000.jpg) no-repeat;}
	img{ margin:-20px 0 0 10px; }
	.png-bg{width:341px; height:258px; margin:10px auto 0; background:url(http://www.iinterest.net/wp-content/uploads/2009/11/windows.png) no-repeat; text-align:center; line-height:258px;}
&lt;/style&gt;
&lt;script src=&quot;http://www.iinterest.net/demo/js/iepng.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
   GtPNG.fix('div, ul, img, li, input');  //GtPNG.fix 自定义包含透明PNG图片的标签,多个标签之间用英文逗号隔开。
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;box&quot;&gt;
    &lt;div class=&quot;png-bg&quot;&gt;png-bg&lt;/div&gt;
    &lt;img src=&quot;http://www.iinterest.net/wp-content/uploads/2009/11/windows.png&quot; alt=&quot;&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_7J7X1n');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_7J7X1n');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p><a href="http://www.iinterest.net/demo/js/iepng.js" target="_blank">demo中iepng.js下载</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.iinterest.net/2009/11/13/transparent-png-in-ie6/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>针对IE8的HACK</title>
		<link>http://www.iinterest.net/2009/11/03/ie8-hack/</link>
		<comments>http://www.iinterest.net/2009/11/03/ie8-hack/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 09:08:42 +0000</pubDate>
		<dc:creator>Bell</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://iinterest.net/blog/?p=536</guid>
		<description><![CDATA[前段时间费了好大的劲才弄了个伪IE8&#160;hack(关于IE8的HACK)&#8230;最近发现原来IE8是存在私有hack的,真悲剧&#8230; background:#ff6600\0; /*IE8 hack*/ 测试: &#60;!DOCTYPE html&#62; &#60;head&#62; &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=gb2312&#34; /&#62; &#60;title&#62;CSS阴影&#60;/title&#62; &#60;style type=&#34;text/css&#34;&#62; div{ width:100px; height:100px; background:#f1f1f1; background:#ff6600\0;} &#60;/style&#62; &#60;/head&#62; &#60;body&#62; &#60;div&#62;这个盒子的背景在IE8下是橙色的&#60;/div&#62; &#60;/body&#62; &#60;/html&#62; 提示：你可以先修改部分代码再运行。]]></description>
			<content:encoded><![CDATA[<p>前段时间费了好大的劲才弄了个伪IE8&nbsp;hack(<a href="http://iinterest.net/blog/2009/10/20/about-ie8-hack/">关于IE8的HACK</a>)&#8230;最近发现原来IE8是存在私有hack的,真悲剧&#8230;</p>
<blockquote><p>background:#ff6600\0; /*IE8 hack*/</p></blockquote>
<p>测试:</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_z0kxQP">
&lt;!DOCTYPE html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot; /&gt;
&lt;title&gt;CSS阴影&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
div{ width:100px; height:100px; background:#f1f1f1; background:#ff6600\0;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div&gt;这个盒子的背景在IE8下是橙色的&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_z0kxQP');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_z0kxQP');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.iinterest.net/2009/11/03/ie8-hack/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>关于IE8的HACK</title>
		<link>http://www.iinterest.net/2009/10/20/about-ie8-hack/</link>
		<comments>http://www.iinterest.net/2009/10/20/about-ie8-hack/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 15:01:38 +0000</pubDate>
		<dc:creator>Bell</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://iinterest.net/blog/?p=515</guid>
		<description><![CDATA[这篇文章悲剧了&#8230;请移步针对IE8的HACK 这里介绍的IE8 hack其实名不副实,因为目前我还未找IE8的私有hack,记得beta时期有过,但那些hack在随后的正式版中被修复了,囧.所以IE8的hack其实就是其他浏览器hack的集合&#8230;看个例子: select{ left:-57px; left:4px\9; #left:-57px; _left:-57px;} left:-57px;  全局定义,所有浏览器都识别 [FF,chrome] left:4px\9;  IE hack,非IE浏览器无法识别 [IE8] #left:-57px;  IE7,6 识别  [IE7] _left:-57px;  IE6 识别  [IE6] 从例子可以看出,先是通过②定义全部IE的样式,再通过③④覆盖定义IE7,6的样式,这样使得IE8的最终解析为 left:4px\9; 虽然复杂了点,但还是可以达到预期的效果&#8230;不过最后还是啰嗦一句:Hack就像是止痛药,必要的时候还是可以救急,但滥用的话后果很严重&#8230;]]></description>
			<content:encoded><![CDATA[<p><strong>这篇文章悲剧了&#8230;请移步<a href="http://iinterest.net/blog/2009/11/03/ie8-hack/">针对IE8的HACK</a></strong></p>
<p>这里介绍的IE8 hack其实名不副实,因为目前我还未找IE8的私有hack,记得beta时期有过,但那些hack在随后的正式版中被修复了,囧.所以IE8的hack其实就是其他浏览器hack的集合&#8230;看个例子:</p>
<blockquote><p>select{ left:-57px; left:4px\9; #left:-57px; _left:-57px;}</p></blockquote>
<ol>
<li>left:-57px;  全局定义,所有浏览器都识别 [FF,chrome]</li>
<li>left:4px\9;  IE hack,非IE浏览器无法识别 [IE8]</li>
<li>#left:-57px;  IE7,6 识别  [IE7]</li>
<li>_left:-57px;  IE6 识别  [IE6]</li>
</ol>
<p>从例子可以看出,先是通过②定义全部IE的样式,再通过③④覆盖定义IE7,6的样式,这样使得IE8的最终解析为 left:4px\9;</p>
<p>虽然复杂了点,但还是可以达到预期的效果&#8230;不过最后还是啰嗦一句:Hack就像是止痛药,必要的时候还是可以救急,但滥用的话后果很严重&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iinterest.net/2009/10/20/about-ie8-hack/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>关于IE8的兼容性问题</title>
		<link>http://www.iinterest.net/2009/08/08/ie8-compatibility/</link>
		<comments>http://www.iinterest.net/2009/08/08/ie8-compatibility/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 02:24:36 +0000</pubDate>
		<dc:creator>Bell</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://iinterest.net/blog/?p=428</guid>
		<description><![CDATA[最近装了win7,体验了下传说中的IE8,作为一个用户而言,IE8的速度和稳定性相对于IE6,7都有很大的提升,但还是存在许多兼容性问题,所以我一直想把win7上的IE8降级为I7,但至今都没有找到方法.如果你跟我一样,或者你喜欢IE8的速度,只是对他的兼容性颇有微词,那么你可以: 点击IE8右上部的&#8221;页面&#8221;-&#62;&#8221;兼容性设置&#8221;,点选&#8221;在兼容性视图中显示所有网站&#8221;,或者自己指定也行. 作为web设计师,你也不必对IE8的兼容性问题感到头痛,你只用加一句代码就可以让IE8进入兼容模式 &#60;meta http-equiv=&#8221;X-UA-Compatible&#8221; content=&#8221;IE=EmulateIE7&#8243; /&#62;]]></description>
			<content:encoded><![CDATA[<p>最近装了win7,体验了下传说中的IE8,作为一个用户而言,IE8的速度和稳定性相对于IE6,7都有很大的提升,但还是存在许多兼容性问题,所以我一直想把win7上的IE8降级为I7,但至今都没有找到方法.如果你跟我一样,或者你喜欢IE8的速度,只是对他的兼容性颇有微词,那么你可以:</p>
<p>点击IE8右上部的&#8221;页面&#8221;-&gt;&#8221;兼容性设置&#8221;,点选&#8221;在兼容性视图中显示所有网站&#8221;,或者自己指定也行.</p>
<p>作为web设计师,你也不必对IE8的兼容性问题感到头痛,你只用加一句代码就可以让IE8进入兼容模式</p>
<p>&lt;meta http-equiv=&#8221;X-UA-Compatible&#8221; content=&#8221;IE=EmulateIE7&#8243; /&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iinterest.net/2009/08/08/ie8-compatibility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE下绝对定位的BUG</title>
		<link>http://www.iinterest.net/2009/07/31/ie-poistion-absolute-bug/</link>
		<comments>http://www.iinterest.net/2009/07/31/ie-poistion-absolute-bug/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 08:29:01 +0000</pubDate>
		<dc:creator>Bell</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[IE bug]]></category>

		<guid isPermaLink="false">http://iinterest.net/blog/?p=402</guid>
		<description><![CDATA[项目中经常会用到层的绝对定位,但在IE6,IE7中它的表现却与其他浏览器存在差异,姑且算是一个IE的BUG吧(IE8除外). 先来看看这个BUG的触发条件: 先建立一个简单的模型,一个有固定宽度水平居中的容器wrapper,一个绝对定位的层position-box;这里讨论的是position-box并未设置left,right,top,bottom等属性的情况下的效果,这时候position-box对象会遵从正常的HTML布局规则,在前一个对象之后立即被呈递. &#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Strict//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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=gb2312&#34; /&#62; &#60;title&#62;iinterest&#60;/title&#62; &#60;style type=&#34;text/css&#34;&#62; *{ margin:0; padding:0;} .wrapper{ width:600px; height:300px; margin:0 auto; background:#FC3; overflow:hidden; } .position-box{ position:absolute; width:100px; height:100px; background:#6CF;} &#60;/style&#62; &#60;/head&#62; &#8230; <a href="http://www.iinterest.net/2009/07/31/ie-poistion-absolute-bug/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>项目中经常会用到层的绝对定位,但在IE6,IE7中它的表现却与其他浏览器存在差异,姑且算是一个IE的BUG吧(IE8除外).</p>
<p>先来看看这个BUG的触发条件:</p>
<p>先建立一个简单的模型,一个有固定宽度水平居中的容器wrapper,一个绝对定位的层position-box;<span style="color: #ff0000;">这里讨论的是position-box并未设置left,right,top,bottom等属性的情况下的效果,这时候position-box对象会遵从正常的HTML布局规则,在前一个对象之后立即被呈递.</span></p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_cQNfBC">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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=gb2312&quot; /&gt;
&lt;title&gt;iinterest&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
*{ margin:0; padding:0;}
.wrapper{ width:600px; height:300px; margin:0 auto; background:#FC3; overflow:hidden; }
.position-box{ position:absolute; width:100px; height:100px; background:#6CF;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;position-box&quot;&gt;1&lt;/div&gt;
&lt;div class=&quot;wrapper&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_cQNfBC');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_cQNfBC');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>运行代码后可以看到效果:<br />
<span id="more-402"></span><br />
IE6 &amp; 7 (下文都以IE7为例)</p>
<p><img class="alignnone" title="pic" src="http://api.photoshop.com/home_aaa9cc05ee874f8fb3929d4ce5c41105/adobe-px-assets/9a1410b966d24b82be6015e189f62ff4" alt="" width="600" height="162" /></p>
<p>FF,IE8,opera&#8230; (下文都以FF为例)</p>
<p><img class="alignnone" title="pic" src="http://api.photoshop.com/home_aaa9cc05ee874f8fb3929d4ce5c41105/adobe-px-assets/6b94a7f50a8341da9c7f8688a960be6d" alt="" width="600" height="161" /></p>
<p>很明显的看出在IE6,7中position-box的定位是以wrapper容器的左顶点为起始点,而在FF中起始点是浏览器窗体的左顶点(或者说是以body顶点为起始点).</p>
<p>改变一下布局,让wrapper先于position-box载入,这时IE7中的效果就与FF中一致了(这也是与CSS文档中所描述的规则相符的,上面红字部分).</p>
<p><img class="alignnone" title="pic" src="http://api.photoshop.com/home_aaa9cc05ee874f8fb3929d4ce5c41105/adobe-px-assets/0f4cc8048d75460bb31e8adbb2200e61" alt="" width="600" height="169" /></p>
<p>然后我们把position-box放入wrapper中再增加一个向左浮动的层sidebar,让sidebar后于position-box载入,并调整sidebar的浮动方向(float:left;float:right&#8230;)看看效果:</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_LaA4Io">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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=gb2312&quot; /&gt;
&lt;title&gt;无标题文档&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
*{ margin:0; padding:0;}
.wrapper{ width:600px; height:300px; margin:0 auto; background:#FC3; overflow:hidden; }
.position-box{ position:absolute; width:100px; height:100px; background:#6CF;}
.sidebar{ float:left; width:200px; height:300px; background:#d7d7d7;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;wrapper&quot;&gt;
	&lt;div class=&quot;position-box&quot;&gt;1&lt;/div&gt;
    &lt;div class=&quot;sidebar&quot;&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_LaA4Io');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_LaA4Io');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p><img class="alignnone" title="pic" src="http://api.photoshop.com/home_aaa9cc05ee874f8fb3929d4ce5c41105/adobe-px-assets/9cbd1dc62a7a44b583f6846c15c845ae" alt="" width="598" height="162" /></p>
<p>结果FF下,position-box并没改变,但IE7下却受到sidebar浮动方向的影响,<span style="color: #ff0000;">也就是说IE6,7的position属性会受到相邻容器布局的<strong>同时</strong>影响,</span>而非FF等浏览器中只受前一个容器布局的影响,我想这就是IE6,7中呈现出的效果与FF等浏览器中不一致的原因.</p>
<p>那么如何消除这个BUG呢,因为IE6,7会受到上下相邻容器的同时影响,所以先得把情况简单化,就是让position-box最早载入,这样就只会被后面的容器所影响(而在FF中是不会受影响的)再就是就是增加一个宽度100%的容器,这样不管后面的容易怎样布局,position-box都只会被100%宽度所影响,从而将起始点定在该容器的左顶点,最终的效果就与FF等一致了.</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_TMLtm1">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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=gb2312&quot; /&gt;
&lt;title&gt;无标题文档&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
*{ margin:0; padding:0;}
.wrapper{ width:600px; height:300px; margin:0 auto; background:#FC3; overflow:hidden; }
.position-box{ position:absolute; width:100px; height:100px; background:#6CF;}
.sidebar{ float:left; width:200px; height:300px; background:#d7d7d7;}
.clear{ width:100%; height:0px; overflow:hidden;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;wrapper&quot;&gt;
	&lt;div class=&quot;position-box&quot;&gt;1&lt;/div&gt;
    &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;sidebar&quot;&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_TMLtm1');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_TMLtm1');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p><img class="alignnone" title="pic"  src="http://api.photoshop.com/home_aaa9cc05ee874f8fb3929d4ce5c41105/adobe-px-assets/44bebcbdfa5b4ea4b61729a0380937e9" width="400" height="200"/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.iinterest.net/2009/07/31/ie-poistion-absolute-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
