<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[gOxiA=苏繁=SuFan Blog]]></title> 
<link>https://maytide.net/index.php</link> 
<description><![CDATA[gOxiA,苏繁,sufan,Microsoft MVP]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[gOxiA=苏繁=SuFan Blog]]></copyright>
<item>
<link>https://maytide.net/read.php/817.htm</link>
<title><![CDATA[调用样式表]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[网络编程]]></category>
<pubDate>Fri, 02 Dec 2005 08:47:58 +0000</pubDate> 
<guid>https://maytide.net/read.php/817.htm</guid> 
<description>
<![CDATA[ 
	<h3>外部调用样式表</h3>在以前，通常采用2种方法使用样式表： <ul><li>页面内嵌法：就是将样式表直接写在页面代码的head区。类似这样： </li></ul><p><div class="code"><span class=\"code\"><font color=\"#60a179\"><strong>&lt;style type=&quot;text/css&quot;&gt; &lt;!-- body &#123; background : white ; color : black ; &#125; --&gt; &lt;/style&gt;</strong></font><font color=\"#000000\"></div></font></span> </p><ul><li>外部调用法：将样式表写在一个独立的.css文件中，然后在页面head区用类似以下代码调用。 </li></ul><p><div class="code"><span class=\"code\"><strong><font color=\"#60a179\">&lt;link rel=&quot;stylesheet&quot; rev=&quot;stylesheet&quot; href=&quot;css/style.css&quot; type=&quot;text/css&quot; media=&quot;all&quot; /&gt;</font></strong></span> </div></p><h3>双表法调用样式表</h3><p>查看某些符合标准站点的原代码，可能会看到，在调用样式表的地方有如下2句：</p><span class="code"><font color="#60a179"><font color="#000000"><div class="code"></font><strong>&lt;link rel=&quot;stylesheet&quot; rev=&quot;stylesheet&quot; href=&quot;css/style.css&quot; type=&quot;text/css&quot; media=&quot;all&quot; /&gt;</strong></font></span> <span class=\"code\"><strong><font color=\"#60a179\">&lt;style type=&quot;text/css&quot; media=&quot;all&quot;&gt;@import url( css/style01.css );&lt;/style&gt;</font></strong></span> </div><p>为什么要写两次呢？</p><p>实际上一般情况下用外联法调用(就是第一句)就足够了。这里使用双表调用只是一种示例。其中的&quot;@import&quot;命令用于输入样式表。而&quot;@import&quot;命令在netscape 4.0版本浏览器是无效的。也就是说，当希望某些效果在netscape 4.0浏览器中隐藏，在4.0以上或其它浏览器中又显示的时候，可以采用&quot;@import&quot;命令方法调用样式表。</p>
]]>
</description>
</item>
</channel>
</rss>