<?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; hack</title>
	<atom:link href="http://www.zui88.com/view-tag/hack/feed" rel="self" type="application/rss+xml" />
	<link>http://www.zui88.com/blog</link>
	<description>中山php&#124;最优网络</description>
	<lastBuildDate>Mon, 13 May 2013 04:56:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>CSS hack之!important;下划线，星号</title>
		<link>http://www.zui88.com/blog/view-336.html</link>
		<comments>http://www.zui88.com/blog/view-336.html#comments</comments>
		<pubDate>Fri, 24 Feb 2012 09:31:59 +0000</pubDate>
		<dc:creator>lin</dc:creator>
				<category><![CDATA[网站前端]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[hack]]></category>

		<guid isPermaLink="false">http://www.zui88.com/blog/?p=336</guid>
		<description><![CDATA[星号" * " ：ie6 ie7支持 hirefox不支持 下划线"_"：ie6支持 ie7 firefox不支持 !important; ： firefox ie7支持 ，ie6部分支持 IE6支持重定义中的!important，例如： 　　.yuanxin {color:#e00!important;} 　　.yuanxin {color:#000;} 　　你将会发现定义了样式class="yuanxin"时，在IE下，字体显示为红色（#e00）。 　　但不支持同一定义中的!important。例如： 　　.yuanxin {color:#e00!important;color:#000} 　　此时在IE6下不支持，你将会发现定义了样式class="yuanxin"时，字体显示为黑色（#000）。 &#160; HTML头部引用(if IE)Hack：针对所有IE：&#60;!--[if IE]&#62;&#60;!--您的代码--&#62;&#60;![endif]--&#62;，针对IE6及以下版本：&#60;!--[if lt IE 7]&#62;&#60;!--您的代码--&#62;&#60;![endif]--&#62;，这类Hack不仅对CSS生效，对写在判断语句里面的所有代码都 会生效。 选择器Hack：比如 IE6能识别*html .class{}，IE7能识别*+html .class{}或者*:first-child+html .class{}。等等 浏览器优先级别:FF&#60;IE7&#60;IE6,CSS hack书写顺序一般为FF IE7 IE6 以: " #demo {width:100px;} "为例; #demo {width:100px;} /*被FIREFOX,IE6,IE7执行.*/ * html #demo {width:120px;} /*会被IE6执行,之前的定义会被后来的覆盖,所以#demo的宽度在IE6就为120px; */ [...]]]></description>
			<content:encoded><![CDATA[<p>星号" * " ：ie6 ie7支持 hirefox不支持</p>
<p>下划线"_"：ie6支持 ie7 firefox不支持</p>
<p>!important; ： firefox ie7支持 ，ie6部分支持</p>
<p>IE6支持重定义中的!important，例如： 　　.yuanxin {color:#e00!important;} 　　.yuanxin {color:#000;} 　　你将会发现定义了样式class="yuanxin"时，在IE下，字体显示为红色（#e00）。 　　但不支持同一定义中的!important。例如： 　　.yuanxin {color:#e00!important;color:#000} 　　此时在IE6下不支持，你将会发现定义了样式class="yuanxin"时，字体显示为黑色（#000）。</p>
<p>&nbsp;</p>
<p>HTML头部引用(if IE)Hack：针对所有IE：&lt;!--[if  IE]&gt;&lt;!--您的代码--&gt;&lt;![endif]--&gt;，针对IE6及以下版本：&lt;!--[if lt IE  7]&gt;&lt;!--您的代码--&gt;&lt;![endif]--&gt;，这类Hack不仅对CSS生效，对写在判断语句里面的所有代码都 会生效。</p>
<p>选择器Hack：比如 IE6能识别*html .class{}，IE7能识别*+html .class{}或者*:first-child+html .class{}。等等</p>
<p>浏览器优先级别:FF&lt;IE7&lt;IE6,CSS hack书写顺序一般为FF IE7 IE6</p>
<p><strong>以: " #demo {width:100px;} "为例;</strong></p>
<p><strong> </strong> <strong>#demo {width:100px;} /*被FIREFOX,IE6,IE7执行.*/ </strong></p>
<p><strong>* html #demo {width:120px;} /*会被IE6执行,之前的定义会被后来的覆盖,所以#demo的宽度在IE6就为120px; */ </strong></p>
<p><strong>*+html #demo {width:130px;} /*会被IE7执行*/ </strong> <strong>--------------- </strong></p>
<p><strong>所以最后,#demo的宽度在三个浏览器的解释为: </strong></p>
<p><strong>FIREFOX:100px; </strong></p>
<p><strong>ie6:120px; </strong></p>
<p><strong>ie7:130px; </strong> <strong> </strong></p>
<p><strong>IE8 最新css hack：</strong></p>
<p><strong> </strong> <strong>"\9"　例:"border:1px \9;".这里的"\9"可以区别所有IE和FireFox.</strong></p>
<p><strong><strong>"\0"　IE8识别，IE6、IE7不能.</strong> </strong><strong></strong></p>
<h3><a name="3_1"></a>IE6 hack</h3>
<p>_background-color:#CDCDCD; /* ie 6*/</p>
<h3><a name="3_2"></a>IE7 hack</h3>
<p>*background-color:#dddd00; /* ie 7*/</p>
<h3><a name="3_3"></a>IE8 hack</h3>
<p>background-color:red\0; /* ie 8/9*/</p>
<h3><a name="3_4"></a>IE9 hack</h3>
<p>background-color:blue\9\0;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zui88.com/blog/view-336.html/feed</wfw:commentRss>
		<slash:comments>287</slash:comments>
		</item>
	</channel>
</rss>
