<?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>╭╰Original　Colors╯╮ - 认真工作 &#187; 浏览器兼容</title>
	<atom:link href="http://www.iros.me/tag/%e6%b5%8f%e8%a7%88%e5%99%a8%e5%85%bc%e5%ae%b9/feed" rel="self" type="application/rss+xml" />
	<link>http://www.iros.me</link>
	<description>show the colorsssssss in my WORK</description>
	<lastBuildDate>Fri, 09 Sep 2011 06:29:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>使用CSS Expression解决某些浏览器兼容问题</title>
		<link>http://www.iros.me/expression-solve-compatibility-problems.html</link>
		<comments>http://www.iros.me/expression-solve-compatibility-problems.html#comments</comments>
		<pubDate>Mon, 15 Dec 2008 09:45:01 +0000</pubDate>
		<dc:creator>ponytail</dc:creator>
				<category><![CDATA[┨DIV+CSS]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[expression]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[浏览器兼容]]></category>

		<guid isPermaLink="false">http://www.originalcolors.cn/work/?p=313</guid>
		<description><![CDATA[虽然无奈，但是不想一有什么就去写JS，冲突也会是个头痛的问题，所以这个Expression还是挺有用的，在CSS代码后插入expression语句，自定义控制属性，只被IE识别的方法，通常针对IE6及其一下的版本居多，IE7对CSS的支持已经有了很大改进，会用到的情况比较少，IE8已宣布在其标准模式下不再支持这一语句，呵呵，多好啊，以后为不同版本的IE还要多写几份HACK，咱们不怕没工作做了哩~~无奈到想哭。。。 1. min-width/max-width 控制容器最小宽度或图片最大宽度，对IE6及其以下版本无效 div { width:100%; min-width:600px; width:expression(this.Width &#60; 600 ? &#8220;600px&#8221; :&#8221;100%&#8221; ); } img { max-width:750px; width:expression(onload=function() { this.style.width=(this.offsetWidth &#62; 750)?&#8221;750px&#8221;:&#8221;auto&#8221; } /* max-width: 750px; width:expression(this.offsetWidth&#62; 750? &#8220;750px&#8221; : this.offsetWidth+&#8221;px&#8221;) ; 不要使用这种写法，初次载入图片有时会很小，需刷新 */ 2. position:fixed IE6下无效 div { position: absolute; top:expression(eval(document .compatMode &#38;&#38;  document .compatMode==&#8217;CSS1Compat&#8217;) ?  documentElement.scrollTop  +(documentElement.clientHeight-this.clientHeight) &#8211; 1 : document.body.scrollTop  [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.iros.me%2Fcss-browser-support.html&from=http%3A%2F%2Fwww.iros.me%2Fexpression-solve-compatibility-problems.html">
                        <font size="-1" color="#666666" style="line-height: 1.65em; font-size: 12px !important;">CSS选择器之浏览器支持汇总，IE8/FF 3.5 beta/Safari 4 Beta/iPhone包括</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.iros.me%2Fietester-wonderful-ie-compatibility-test-tool.html&from=http%3A%2F%2Fwww.iros.me%2Fexpression-solve-compatibility-problems.html">
                        <font size="-1" color="#666666" style="line-height: 1.65em; font-size: 12px !important;">含泪推荐 IETester 用作IE兼容性测试（5.5/6/7/8Beta2四个版本）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.iros.me%2Fkill-ie6-2.html&from=http%3A%2F%2Fwww.iros.me%2Fexpression-solve-compatibility-problems.html">
                        <font size="-1" color="#666666" style="line-height: 1.65em; font-size: 12px !important;">【转载】Web技术要发展，IE6必须被消灭！</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.iros.me%2Fcss-hacks.html&from=http%3A%2F%2Fwww.iros.me%2Fexpression-solve-compatibility-problems.html">
                        <font size="-1" color="#666666" style="line-height: 1.65em; font-size: 12px !important;">来来来，大家都来写CSS HACK吧~ IE5/6/7/8 + FF1/2/3 + Safari + Chrome + Opera</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  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>虽然无奈，但是不想一有什么就去写JS，冲突也会是个头痛的问题，所以这个Expression还是挺有用的，在CSS代码后插入expression语句，自定义控制属性，只被IE识别的方法，通常针对IE6及其一下的版本居多，IE7对CSS的支持已经有了很大改进，会用到的情况比较少，IE8已宣布在其标准模式下不再支持这一语句，呵呵，多好啊，以后为不同版本的IE还要多写几份HACK，咱们不怕没工作做了哩~~无奈到想哭。。。</p>
<p>1. min-width/max-width 控制容器最小宽度或图片最大宽度，对IE6及其以下版本无效</p>
<p>div {<br/>
width:100%;<br/>
min-width:600px;<br/>
width:expression(this.Width &lt; 600 ? &#8220;600px&#8221; :&#8221;100%&#8221; );<br/>
}</p>
<p><span id="more-313" ></span>img {<br/>
max-width:750px;<br/>
width:expression(onload=function() {<br/>
this.style.width=(this.offsetWidth &gt; 750)?&#8221;750px&#8221;:&#8221;auto&#8221;<br/>
}</p>
<p>/*<br/>
max-width: 750px;<br/>
width:expression(this.offsetWidth&gt; 750? &#8220;750px&#8221; : this.offsetWidth+&#8221;px&#8221;) ;<br/>
不要使用这种写法，初次载入图片有时会很小，需刷新<br/>
*/</p>
<p>2. position:fixed IE6下无效</p>
<p>div {<br/>
position: absolute;<br/>
top:expression(eval(document .compatMode &amp;&amp;  document .compatMode==&#8217;CSS1Compat&#8217;) ?  documentElement.scrollTop  +(documentElement.clientHeight-this.clientHeight) &#8211; 1 : document.body.scrollTop  +(document.body.clientHeight-this.clientHeight) &#8211; 1;<br/>
}</p>
<p>/*</p>
<p>div {<br/>
position: absolute;<br/>
left: expression( (johndoe2 = document.documentElement.scrollLeft ?<br/>
document.documentElement.scrollLeft : document.body.scrollLeft ) + &#8217;px&#8217; );<br/>
top: expression( (johndoe1 = document.documentElement.scrollTop ?<br/>
document.documentElement.scrollTop : document.body.scrollTop ) + &#8217;px&#8217; );<span style="color: #ff0000; background-color: #f5f5f5;" ><br/>
</span>}<span style="color: #ff0000; background-color: #f5f5f5;" ><br/>
</span></p>
<p>实际用了下，上面那种好像不太保险的，下面这个OK的~~ 但是注意，这种方式因为是不停的用expression计算位置，滚动过程中会有抖动的</p>
<p>另外还找到了一种<a  href="http://www.scriptlover.com/controls/FixedPosition/" target="_self">JS实现方法</a>，如果你有多个需要固定的DIV，并且这种方式没有抖动~~</p>
<p>*/</p>
<p>3. 实现伪类的Hover效果</p>
<p>span.link {<br/>
cursor:pointer;<br/>
color: blue;<br/>
text-decoration: none;<br/>
m: expression(this.onmouseover =  new Function(&#8220;this.className = &#8221;link-hover&#8221;;&#8221;));<br/>
}</p>
<p>4. 消除页面链接虚线</p>
<p>a {<br/>
star: expression(onfocus=this.blur)<br/>
}</p>
<p>其他还有做隔行换色表格啦~鼠标移上更换图片啦~其他什么的，需要注意的是，expression这种东西能不用还是不要轻易使用，因为是比较消耗浏览器资源滴，不仅仅是在页面显示和缩放时，就是在页面滚动、乃至移动鼠标时都会要重新计算一次。</p>
<p>在新型浏览器迈着轻松的步子优雅前行的时候，身后不知道瘫倒着多少像俺这样写HACK的可怜娃啊，喂！~ 还真就说不管就不管啦？~ 那你起码回个头把你家不争气的小子处理掉先啊！~~  555，还真是可怜的娃，谁都来欺负一把，现在是IE三兄弟、FF3、Safari、Opera、Chrome都压上身了，我爬。。。好重。。。</p>
<table class="wumii-related-items"  cellspacing="0"  cellpadding="2"  border="0"  width="100%"  style="clear: both;" >
    
    <tr>
        <td><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;" >您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;" >
                    <img border="0"  src="http://static.wumii.com/images/widget/widget_solidPoint.gif" />
                    <a  target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.iros.me%2Fcss-browser-support.html&#038;from=http%3A%2F%2Fwww.iros.me%2Fexpression-solve-compatibility-problems.html">
                        <font size="-1"  color="#666666"  style="line-height: 1.65em; font-size: 12px !important;" >CSS选择器之浏览器支持汇总，IE8/FF 3.5 beta/Safari 4 Beta/iPhone包括</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;" >
                    <img border="0"  src="http://static.wumii.com/images/widget/widget_solidPoint.gif" />
                    <a  target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.iros.me%2Fietester-wonderful-ie-compatibility-test-tool.html&#038;from=http%3A%2F%2Fwww.iros.me%2Fexpression-solve-compatibility-problems.html">
                        <font size="-1"  color="#666666"  style="line-height: 1.65em; font-size: 12px !important;" >含泪推荐 IETester 用作IE兼容性测试（5.5/6/7/8Beta2四个版本）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;" >
                    <img border="0"  src="http://static.wumii.com/images/widget/widget_solidPoint.gif" />
                    <a  target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.iros.me%2Fkill-ie6-2.html&#038;from=http%3A%2F%2Fwww.iros.me%2Fexpression-solve-compatibility-problems.html">
                        <font size="-1"  color="#666666"  style="line-height: 1.65em; font-size: 12px !important;" >【转载】Web技术要发展，IE6必须被消灭！</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;" >
                    <img border="0"  src="http://static.wumii.com/images/widget/widget_solidPoint.gif" />
                    <a  target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.iros.me%2Fcss-hacks.html&#038;from=http%3A%2F%2Fwww.iros.me%2Fexpression-solve-compatibility-problems.html">
                        <font size="-1"  color="#666666"  style="line-height: 1.65em; font-size: 12px !important;" >来来来，大家都来写CSS HACK吧~ IE5/6/7/8 + FF1/2/3 + Safari + Chrome + Opera</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td 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>
	标签：<a href="http://www.iros.me/tag/css" title="CSS" rel="tag">CSS</a>, <a href="http://www.iros.me/tag/expression" title="expression" rel="tag">expression</a>, <a href="http://www.iros.me/tag/ie6" title="IE6" rel="tag">IE6</a>, <a href="http://www.iros.me/tag/%e6%b5%8f%e8%a7%88%e5%99%a8%e5%85%bc%e5%ae%b9" title="浏览器兼容" rel="tag">浏览器兼容</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.iros.me/expression-solve-compatibility-problems.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

