<?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; 修复</title>
	<atom:link href="http://www.99is.com/website/archives/tag/%e4%bf%ae%e5%a4%8d/feed" rel="self" type="application/rss+xml" />
	<link>http://www.99is.com</link>
	<description>这些年，我乱写的那些文字...</description>
	<lastBuildDate>Sat, 04 Feb 2012 16:20:47 +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的十条修复</title>
		<link>http://www.99is.com/website/archives/399.html</link>
		<comments>http://www.99is.com/website/archives/399.html#comments</comments>
		<pubDate>Mon, 07 Jun 2010 11:46:20 +0000</pubDate>
		<dc:creator>thewei</dc:creator>
				<category><![CDATA[网络来之]]></category>
		<category><![CDATA[那些话儿]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[修复]]></category>
		<category><![CDATA[兼容]]></category>

		<guid isPermaLink="false">http://www.99is.com/?p=399</guid>
		<description><![CDATA[由于我国国情，我知道ie6还会存在很长时间，这一篇文章写的是应景： 我们知道ie会在一段时间内仍然流行，但是我们仍然可以支持浏览器并且避免hacks和条件css吗？这里有十条使用有效的html和css代码修复可以兼容ie6常见的问题。 1、使用一个声明 你必须经常在html网页头部放置一个声明，推荐使用严格的标准。例如 或者xhtml使用 最后你需要是ie6进入兼容模式，这已经足够兼容的了。 2、使用position: relative 设置一个标签position: relative可以解决很多问题，特别是曾经有过看不见的经历或者奇怪布局的框架。明显的，你需要小心，绝对位置放置的子元素是否都参照找到新位置。 3、为浮动元素使用display:inline 浮动元素会有一个著名的ie6双边距margin bug。假如你设置了左边距5px但实际上得到了10px左边距。display:inline可以解决这个问题，尽管它不是必需的，但是css仍然有效。 4、设置元素启动hasLayout 大部分ie6（ie7）的渲染问题都可以通过起来元素的hasLayout属性来兼容。这是ie内置的设定，确定一个内容块相对其它内容块是有界限和位置的。当你需要设置一个行内元素例如一个连接变成块状元素或者是透明效果，设置hasLayout也是必须的。 5、修复重复字符的bug 复杂的布局会触发一个bug：浮动对象的最后字符会出现在已经清除浮动的元素后面。这里有几种解决的办法，部分是理想的，并且一些测试和出错是必须的。 a、确保浮动元素都使用：display:inline； b、最后一个浮动元素使用margin-right:-3px; c、在浮动对象最后一个元素后使用一个条件注释。例如这里输入注释…&#60;![endif] d、在容器内的最后使用一个div空标签（它也必须设置90%宽度甚至更小） 6、使用a标签完成可点击和hover原理 Ie6只支持a标签的css定义hover效果 你可以使用它去控制javascript启动的widgets，使得他们仍然保持键盘操作。这里有个二择一的问题，但是a标签是所有解决方案中最可靠的。 7、使用!important，或是高级选择符替代ie特定代码 在外置的css文件里，放弃凭借传统的hacks和条件判断，使用有效的css代码去针对ie6仍然是有可能的。例如：最小高度可以使用一下定义。 #element { min-height: 20em; height: auto !important; /* understood by all browsers */ height: 20em; /* IE6 incorrectly uses this value /* } Ie6不支持“min-height”并且错误的将20em重写为“auto”。不过，当内容大于设置的空间时，它会增加它的尺寸。 另外一个选择是使用高级选择符。例如 #element { min-height: 20em; [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="1"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="100" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="为IE6鸣丧钟" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F239.html&from=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F399.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 94px !important; height: 94px !important;" src="http://static.wumii.com/site_images/2011/04/13/5550806.jpg" width="94px" height="94px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 100px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">为IE6鸣丧钟</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="1" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>由于我国国情，我知道ie6还会存在很长时间，这一篇文章写的是应景：</p>
<p>我们知道ie会在一段时间内仍然流行，但是我们仍然可以支持浏览器并且避免hacks和条件css吗？这里有十条使用有效的html和css代码修复可以兼容ie6常见的问题。</p>
<p>1、使用一个声明<br />
你必须经常在html网页头部放置一个声明，推荐使用严格的标准。例如</p>
<p>或者xhtml使用</p>
<p>最后你需要是ie6进入兼容模式，这已经足够兼容的了。</p>
<p>2、使用position: relative<br />
设置一个标签position: relative可以解决很多问题，特别是曾经有过看不见的经历或者奇怪布局的框架。明显的，你需要小心，绝对位置放置的子元素是否都参照找到新位置。</p>
<p>3、为浮动元素使用display:inline<br />
浮动元素会有一个著名的ie6双边距margin bug。假如你设置了左边距5px但实际上得到了10px左边距。display:inline可以解决这个问题，尽管它不是必需的，但是css仍然有效。</p>
<p><span id="more-399"></span></p>
<p>4、设置元素启动hasLayout<br />
大部分ie6（ie7）的渲染问题都可以通过起来元素的hasLayout属性来兼容。这是ie内置的设定，确定一个内容块相对其它内容块是有界限和位置的。当你需要设置一个行内元素例如一个连接变成块状元素或者是透明效果，设置hasLayout也是必须的。</p>
<p>5、修复重复字符的bug<br />
复杂的布局会触发一个bug：浮动对象的最后字符会出现在已经清除浮动的元素后面。这里有几种解决的办法，部分是理想的，并且一些测试和出错是必须的。<br />
a、确保浮动元素都使用：display:inline；<br />
b、最后一个浮动元素使用margin-right:-3px;<br />
c、在浮动对象最后一个元素后使用一个条件注释。例如这里输入注释…&lt;![endif]<br />
d、在容器内的最后使用一个div空标签（它也必须设置90%宽度甚至更小）</p>
<p>6、使用a标签完成可点击和hover原理<br />
Ie6只支持a标签的css定义hover效果<br />
你可以使用它去控制javascript启动的widgets，使得他们仍然保持键盘操作。这里有个二择一的问题，但是a标签是所有解决方案中最可靠的。</p>
<p>7、使用!important，或是高级选择符替代ie特定代码<br />
在外置的css文件里，放弃凭借传统的hacks和条件判断，使用有效的css代码去针对ie6仍然是有可能的。例如：最小高度可以使用一下定义。<br />
#element {<br />
min-height: 20em;<br />
height: auto !important; /* understood by all browsers */<br />
height: 20em; /* IE6 incorrectly uses this value /*<br />
}<br />
Ie6不支持“min-height”并且错误的将20em重写为“auto”。不过，当内容大于设置的空间时，它会增加它的尺寸。<br />
另外一个选择是使用高级选择符。例如<br />
#element {<br />
min-height: 20em;<br />
height: 20em;<br />
}<br />
/* ignored by IE6 */<br />
#element[id] {<br />
height: auto;<br />
}</p>
<p>8、避免百分比定义<br />
百分比在ie下比较混乱。除非你非常小心每个父元素的尺寸，这样就大概可以最后避免了。你仍然可以对其他浏览器使用!important来使用百分值。例如：<br />
body {<br />
margin: 2% 0 !important;<br />
margin: 20px 0; /* IE6 only */<br />
}</p>
<p>9、早点和经常测试<br />
在你的网站和应用程序完成之前，不要放弃ie6的测试。问题将会更加严重并且需要很长时间去修复。如果你的网站可以运行于firefox和ie6，它将差不多肯定可以在其它浏览器下运行。</p>
<p>10、重构你的代码<br />
经常的，修复会比重新考虑布局问题更加花费时间。Html细微的修改和更加简单的css经常是最有效的。这意味着你要放弃完美的合法的代码，但是将会更少的问题出现，并且你知道怎样处理将要出现的情况。</p>
<p>http://www.sitepoint.com/blogs/2009/03/06/10-fixes-for-ie6-problems/</p>
<p>作者：Craig Buckler 翻译：清</p>
<p>来自：<a href="http://www.ued163.com/?p=766" target="_blank">网易UED</a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="100" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="为IE6鸣丧钟" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F239.html&from=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F399.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 94px !important; height: 94px !important;" src="http://static.wumii.com/site_images/2011/04/13/5550806.jpg" width="94px" height="94px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 100px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">为IE6鸣丧钟</font>
                    </a>
                </td>
                <td width="100" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="第一帖，学习Icon的开始" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F561.html&from=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F399.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 94px !important; height: 94px !important;" src="http://static.wumii.com/site_images/2011/06/10/11720170.jpg" width="94px" height="94px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 100px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">第一帖，学习Icon的开始</font>
                    </a>
                </td>
                <td width="100" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="提高网站PR的一些问题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F66.html&from=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F399.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 94px !important; height: 94px !important;" src="http://static.wumii.com/site_images/2011/04/13/5550772.jpg" width="94px" height="94px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 100px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">提高网站PR的一些问题</font>
                    </a>
                </td>
                <td width="100" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="我每天都在发现新大陆" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F532.html&from=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F399.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 94px !important; height: 94px !important;" src="http://static.wumii.com/site_images/2011/04/13/5550658.png" width="94px" height="94px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 100px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">我每天都在发现新大陆</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.99is.com/website/archives/399.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

