<?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>随网之舞条件注释</title>
	<atom:link href="http://dancewithnet.com/tag/%e6%9d%a1%e4%bb%b6%e6%b3%a8%e9%87%8a/feed/" rel="self" type="application/rss+xml" />
	<link>http://dancewithnet.com</link>
	<description>WEB Design{HTML:CSS:Javascript:DOM:AJAX:PHP:Usability}/Viewpoint/Photo/Food/Mood</description>
	<lastBuildDate>Mon, 18 Jul 2011 02:45:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>IE中的条件注释</title>
		<link>http://dancewithnet.com/2006/06/06/ie-conditional-comments/</link>
		<comments>http://dancewithnet.com/2006/06/06/ie-conditional-comments/#comments</comments>
		<pubDate>Mon, 05 Jun 2006 19:49:53 +0000</pubDate>
		<dc:creator>秦歌</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[条件注释]]></category>

		<guid isPermaLink="false">http://dancewithnet.com/?p=903</guid>
		<description><![CDATA[一、条件注释简介

IE中的条件注释（Conditional comments）对IE的版本和IE非IE有优秀的区分能力，是WEB设计中常用的hack方法。
条件注释只能用于IE5以上。
如果你安装了多个IE，条件注释将会以最高... ]]></description>
			<content:encoded><![CDATA[<h3>一、条件注释简介</h3>
<ol>
<li>IE中的条件注释（Conditional comments）对IE的版本和IE非IE有优秀的区分能力，是WEB设计中常用的hack方法。</li>
<li>条件注释只能用于IE5以上。</li>
<li>如果你安装了多个IE，条件注释将会以最高版本的IE为标准。</li>
<li>条件注释的基本结构和HTML的注释(&lt;!&#8211; &#8211;&gt;)是一样的。因此IE以外的浏览器将会把它们看作是普通的注释而完全忽略它们。</li>
<li>IE将会根据if条件来判断是否如解析普通的页面内容一样解析条件注释里的内容。</li>
</ol>
<p><span id="more-903"></span></p>
<h3>二、条件注释属性</h3>
<ul>
<li>gt : greater than，选择条件版本以上版本，不包含条件版本</li>
<li>lt : less than，选择条件版本以下版本，不包含条件版本</li>
<li>gte : greater than or equal，选择条件版本以上版本，包含条件版本</li>
<li>lte : less than or equal，选择条件版本以下版本，包含条件版本</li>
<li>! : 选择条件版本以外所有版本，无论高低</li>
</ul>
<h3>三、条件注释使用方法</h3>
<p>注意把代码中的&lt;&gt;换成英文中相应的大于或小于号</p>
<pre><code>&lt;!--[if IE 5]&gt;仅IE5.5可见&lt;![endif]--&gt;
&lt;!--[if gt IE 5.5]&gt;仅IE 5.5以上可见&lt;![endif]--&gt;
&lt;!--[if lt IE 5.5]&gt;仅IE 5.5以下可见&lt;![endif]--&gt;
&lt;!--[if gte IE 5.5]&gt;IE 5.5及以上可见&lt;![endif]--&gt;
&lt;!--[if lte IE 5.5]&gt;IE 5.5及以下可见&lt;![endif]--&gt;
&lt;!--[if !IE 5.5]&gt;非IE 5.5的IE可见&lt;![endif]--&gt;</code></pre>
<p>下面的代码是在非IE浏览器下运行的条件注释</p>
<pre><code>&lt;!--[if !IE]&gt;&lt;!--&gt;
您使用不是 Internet Explorer
&lt;!--&lt;![endif]--&gt;
&lt;!--[if IE 6]&gt;&lt;!--&gt;
您正在使用Internet Explorer version 6或者 一个非IE 浏览器
&lt;!--&lt;![endif]--&gt;</code></pre>
<h3>参考</h3>
<ul class="refer">
<li>[1]<a href="http://www.surfchen.org/?p=94">IE中的条件注释</a></li>
<li>[2]<a href="http://www.blueidea.com/tech/site/2006/3561.asp">条件注释理论及实践</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dancewithnet.com/2006/06/06/ie-conditional-comments/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

