<?xml version="1.0" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="css/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Guagua513seo技术博客 - 编程与技术</title><link>http://www.guagua513seo.com/</link><description>-搜索引擎优化|电子商务 - </description><generator>RainbowSoft Studio Z-Blog 1.8 Spirit Build 80722</generator><language>zh-CN</language><copyright>版权所有Guagua513seo技术博客。本站采用创作共用版权协议, 要求署名、非商业用途和保持一致. 转载本站内容必须也遵循“署名Guagua513seo.com-非商业用途-保持一致”的创作共用协议.</copyright><pubDate>Tue, 07 Sep 2010 19:41:30 +0800</pubDate><item><title>Apache初级URL重写指南</title><author>guagua513@163.com (guagua513seo)</author><link>http://www.guagua513seo.com/post/34.html</link><pubDate>Fri, 24 Apr 2009 14:23:13 +0800</pubDate><guid>http://www.guagua513seo.com/post/34.html</guid><description><![CDATA[<div class="article" id="blog_article"><div class="resizeimg"><div><div><p>Apache模块 mod_rewrite</p><div><div><a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/mod/module-dict.html#De.ion">说明</a> <a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/mod/module-dict.html#Status">状态</a> <a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/mod/module-dict.html#ModuleIdentifier">模块名</a> <a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/mod/module-dict.html#SourceFile">源文件</a> <a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/mod/module-dict.html#Compatibility">兼容性</a><table cellspacing="0" cellpadding="0" bordercolor="#aaaaaa" border="1" class="module">    <tbody>        <tr>            <td>一个基于一定规则的实时重写URL请求的引擎</td>        </tr>        <tr>            <td>扩展(E)</td>        </tr>        <tr>            <td>rewrite_module</td>        </tr>        <tr>            <td>mod_rewrite.c</td>        </tr>        <tr>            <td>仅在 Apache 1.3 及以后的版本中可用</td>        </tr>    </tbody></table>概述<p>此模块提供了一个基于正则表达式分析器的重写引擎来实时重写URL请求。它支持每个完整规则可以拥有不限数量的子规则以及附加条件规则的灵活而且强 大的URL操作机制。此URL操作可以依赖于各种测试，比如服务器变量、环境变量、HTTP头、时间标记，甚至各种格式的用于匹配URL组成部分的查找数 据库。</p><p>此模块可以操作URL的所有部分(包括路径信息部分)，在服务器级的(<font face="NSimsun">httpd.conf</font>)和目录级的(<font face="NSimsun">.htaccess</font>)配置都有效，还可以生成最终请求字符串。此重写操作的结果可以是内部子处理，也可以是外部请求的转向，甚至还可以是内部代理处理。</p><p>但是，所有这些功能和灵活性带来一个问题，那就是复杂性，因此，不要指望一天之内就能看懂整个模块。</p></div></div><div class="warning">注意：根据你的服务器配置，有可能必须对这里的例子作些小修改，比如，在额外启用<a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/mod/mod_alias.html"><font face="NSimsun">mod_alias</font></a>和<a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/mod/mod_userdir.html"><font face="NSimsun">mod_userdir</font></a>的情况下要增加<font face="NSimsun">[PT]</font>标志，或者为了适应目录级(<font face="NSimsun">.htaccess</font>)的配置而将针对服务器级的规则集进行重写。对一个特定的规则集应该先透彻理解然后再考虑应用，这样才能避免出现问题。</div></div><div class="top"><a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/rewrite/rewrite_guide.html#page-header"><img src="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/images/up.gif" alt="top" /></a></div><div class="section"><a name="canonicalurl">规范化URL</a>  描述：  在有些web服务器上，一个资源会拥有多个URL。在实际应用和发布中应该使用的是规范的URL，其他的则是简写或者只在内部使用。无论用户在请求中使用什么形式的URL，最终看见的都应该是规范的URL。  解决方案：  对所有不规范的URL执行一个外部HTTP重定向，以改变它在浏览器地址栏中的显示及其后继请求。下例中的规则集用规范的<font face="NSimsun">/u/user</font>替换<font face="NSimsun">/~user</font>，并修正了<font face="NSimsun">/u/user</font>所遗漏的后缀斜杠。<div class="example">RewriteRule   ^/<strong>~</strong>([^/]+)/?(.*)    /<strong>u</strong>/$1/$2  [<strong>R</strong>] RewriteRule   ^/([uge])/(<strong>[^/]+</strong>)$  /$1/$2<strong>/</strong>   [<strong>R</strong>]</div></div><div class="top"><a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/rewrite/rewrite_guide.html#page-header"><img src="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/images/up.gif" alt="top" /></a></div><div class="section"><a name="canonicalhost">规范化主机名</a>  描述：  这个规则的目的是强制使用特定的主机名以代替其他名字。比如，你想强制使用<strong>www.example.com</strong>代替<strong>example.com</strong>，就可以在以下方案的基础上进行修改：  解决方案：<p>对运行在非80端口的站点</p><div class="example">RewriteCond %{HTTP_HOST}   !^fully\.qualified\.domain\.name [NC] RewriteCond %{HTTP_HOST}   !^$ RewriteCond %{SERVER_PORT} !^80$ RewriteRule ^/(.*)         http://fully.qualified.domain.name:%{SERVER_PORT}/$1 [L,R]</div><p>对运行在80端口的站点</p><div class="example">RewriteCond %{HTTP_HOST}   !^fully\.qualified\.domain\.name [NC] RewriteCond %{HTTP_HOST}   !^$ RewriteRule ^/(.*)         http://fully.qualified.domain.name/$1 [L,R]</div></div><div class="top"><a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/rewrite/rewrite_guide.html#page-header"><img src="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/images/up.gif" alt="top" /></a></div><div class="section"><a name="moveddocroot">移动过的<font face="NSimsun">DocumentRoot</font></a>  描述：  通常，web服务器的<a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/mod/core.html#documentroot"><font face="NSimsun">DocumentRoot</font></a>直接对应于URL&quot;<font face="NSimsun">/</font>&quot;，但是它常常不是处于最高的一级。比如，你希望访问者在进入网站时首先进入<font face="NSimsun">/about/</font>目录。可以使用下面给出的规则集。  解决方案：  只需将&quot;<font face="NSimsun">/</font>&quot;重定向到&quot;<font face="NSimsun">/about/</font>&quot;即可：<div class="example">RewriteEngine on RewriteRule   <strong>^/$</strong>  /about/  [<strong>R</strong>]</div><p>也可以使用<a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/mod/mod_alias.html#redirectmatch"><font face="NSimsun">RedirectMatch</font></a>指令解决问题：</p><div class="example"><p><font face="NSimsun">RedirectMatch ^/$ http://example.com/e/www/ </font></p></div></div><div class="top"><a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/rewrite/rewrite_guide.html#page-header"><font face="NSimsun"><img src="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/images/up.gif" alt="top" /></font></a></div><div class="section"><a name="trailingslash">结尾斜杠问题</a>  描述：  每个网管对引用目录的结尾斜杠问题都有一本苦经，如果遗漏了，服务器会产生一个错误，因为如果请求是&quot;/~quux/foo&quot;而不是&quot;/~quux/foo/&quot;，服务器就会去找一个叫foo的文件，而它是一个目录，所以就报错了。通常，可以使用这个<a href="http://www.guagua513seo.com/upload/200904241424128724.gif</font>的请求将变成对<font face="NSimsun">/~quux/image.gif</font>的请求！所以，应该这样写：<div class="example">RewriteEngine  on RewriteBase    /~quux/ RewriteRule    ^foo<strong>$</strong>  foo<strong>/</strong>  [<strong>R</strong>]</div><p>又懒又疯狂的做法是把这些写入其宿主目录中的顶级<font face="NSimsun">.htaccess</font>中：</p><div class="example">RewriteEngine  on RewriteBase    /~quux/ RewriteCond    %{REQUEST_FILENAME}  <strong>-d</strong> RewriteRule    ^(.+<strong>[^/]</strong>)$           $1<strong>/</strong>  [R]</div><p>但是这样一来会增加处理上的开销。</p></div><div class="top"><a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/rewrite/rewrite_guide.html#page-header"><img src="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/images/up.gif" alt="top" /></a></div><div class="section"><a name="movehomedirs">将用户主目录移动到不同web服务器</a>  描述：  通常，许多网管在建立一个新的web服务器时，都会有这样的要求：重定向一个web服务器上的所有用户主目录到另一个web服务器。  解决方案：  很简单，在老的web服务器上重定向所有的&quot;<font face="NSimsun">/~user/anypath</font>&quot;到&quot;<font face="NSimsun">http://newserver/~user/anypath</font>&quot;：<div class="example">RewriteEngine on RewriteRule   ^/~(.+)  http://<strong>newserver</strong>/~$1  [R,L]</div></div><div class="top"><a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/rewrite/rewrite_guide.html#page-header"><img src="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/images/up.gif" alt="top" /></a></div><div class="section"><a name="multipledirs">在多个目录中搜索页面</a>  描述：  有时会有必要使web服务器在多个目录中搜索页面，对此，MultiViews或者其他技术无能为力。  解决方案：  编制一个明确的规则集以搜索目录中的文件：<div class="example">RewriteEngine on  # 首先尝试在 <strong>dir1</strong> 中寻找，找到即停 RewriteCond         /your/docroot/<strong>dir1</strong>/%{REQUEST_FILENAME}  -f RewriteRule  ^(.+)  /your/docroot/<strong>dir1</strong>/$1  [L]  # 然后尝试在 <strong>dir2</strong> 中寻找，找到即停 RewriteCond         /your/docroot/<strong>dir2</strong>/%{REQUEST_FILENAME}  -f RewriteRule  ^(.+)  /your/docroot/<strong>dir2</strong>/$1  [L]  # 再找不到就继续寻找其他的 Alias 或 ScriptAlias 目录 RewriteRule   ^(.+)  -  [PT]</div></div><div class="top"><a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/rewrite/rewrite_guide.html#page-header"><img src="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/images/up.gif" alt="top" /></a></div><div class="section"><a name="setenvvars">按照URL的片段设置环境变量</a>  描述：  希望保持请求之间的状态信息，又不希望使用CGI来包装所有页面，只是通过分离URL中的有用信息来做到。  解决方案：  可以用一个规则集来分离出状态信息，并设置环境变量以备此后用于XSSI或CGI。这样，一个&quot;<font face="NSimsun">/foo/S=java/bar/</font>&quot;的URL会被解析为&quot;<font face="NSimsun">/foo/bar/</font>&quot;，而环境变量<font face="NSimsun">STATUS</font>则被设置为&quot;java&quot;。<div class="example">RewriteEngine on RewriteRule   ^(.*)/<strong>S=([^/]+)</strong>/(.*)    $1/$3 [E=<strong>STATUS:$2</strong>]</div></div><div class="top"><a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/rewrite/rewrite_guide.html#page-header"><img src="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/images/up.gif" alt="top" /></a></div><div class="section"><a name="uservhosts">虚拟用户主机</a>  描述：  如果需要为用户username支持一个<font face="NSimsun">www.<strong>username</strong>.host.domain.com</font>的主页，但不在此机器上建虚拟主机，而是仅用在此机器上增加一个DNS A记录的方法实现。  解决方案：  仅能对包含&quot;Host: &quot;头的HTTP/1.1请求实现。可以使用以下规则集内部地将<font face="NSimsun">upload/200904241424198373.gif" alt="top" /></a></div><div class="section"><a name="redirecthome">为外来访问者重定向用户主目录</a>  描述：  对不是来自本地域<font face="NSimsun">ourdomain.com</font>的外来访问者的请求，重定向其用户主目录URL到另一个web服务器<font face="NSimsun">www.somewhere.com</font>，有时这种做法也会用在虚拟主机的配置段中。  解决方案：  只须一个重写条件：<div class="example">RewriteEngine on RewriteCond   %{REMOTE_HOST}  <strong>!^.+\.ourdomain\.com$</strong> RewriteRule   ^(/~.+)         upload/200904241424204142.gif" alt="top" /></a></div><div class="section"><a name="redirectanchors">重定向锚</a>  描述：  默认情况下，重定向到一个HTML锚是不可行的，因为'<font face="NSimsun">#</font>'会被转义为'<font face="NSimsun">%23</font>'。This, in turn, breaks the redirection.  解决方案：  在<font face="NSimsun">RewriteRule</font>指令中使用<font face="NSimsun">[NE]</font>标志(不转义)。</div><div class="top"><a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/rewrite/rewrite_guide.html#page-header"><img src="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/images/up.gif" alt="top" /></a></div><div class="section">依赖于时间的重写  描述：  在页面内容需要按时间的不同而变化的场合，比如重定向特定页面等，许多网管仍然采用CGI脚本的方法，如何用<a href="http://www.guagua513seo.com/upload/200904241424217312.gif" alt="top" /></a></div><div class="section">对YYYY转变为XXXX的向前兼容  描述：  在转变了大批<font face="NSimsun">document.YYYY</font>文件为<font face="NSimsun">document.XXXX</font>后(比如<font face="NSimsun">.html</font>&rarr;<font face="NSimsun">.phtml</font>)，如何保持URL的向前兼容(仍然虚拟地存在)？  解决方案：  只须按基准文件名重写，并测试带有新的扩展名的文件是否存在，如果存在则用新的，否则仍然用原来的。<div class="example"># 将document.html重写为document.phtml的向后兼容的规则集 # 当且仅当document.phtml存在且document.html不存在的时候 RewriteEngine on RewriteBase   /~quux/ # 剪切并记住basename RewriteRule   ^(.*)\.html$              $1      [C,E=WasHTML:yes] # 如果存在的话就重写为document.phtml RewriteCond   %{REQUEST_FILENAME}.phtml -f RewriteRule   ^(.*)$ $1.phtml                   [S=1] # 否则返回先前的basename RewriteCond   %{ENV:WasHTML}            ^yes$ RewriteRule   ^(.*)$ $1.html</div></div><div class="top"><a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/rewrite/rewrite_guide.html#page-header"><img src="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/images/up.gif" alt="top" /></a></div><div class="section"><a name="content">内容处理</a> 从旧到新(内部)  描述：  假定已经把文件<font face="NSimsun">foo.html</font>改名为<font face="NSimsun">bar.html</font>，需要对老的URL向后兼容，即让用户仍然可以使用老的URL，而感觉不到文件被改名了。  解决方案：  通过以下规则内部地将老的URL重写为新的：<div class="example">RewriteEngine  on RewriteBase    /~quux/ RewriteRule    ^<strong>foo</strong>\.html$  <strong>bar</strong>.html</div>从旧到新(外部)  描述：  仍然假定已经把文件<font face="NSimsun">foo.html</font>改名为<font face="NSimsun">bar.html</font>，需要对老的URL向后兼容，但是要让用户得到文件被改名的暗示，即浏览器的地址栏中显示的是新的URL。  解决方案：  作一个HTTP的强制重定向以改变浏览器和用户界面上的显示：<div class="example">RewriteEngine  on RewriteBase    /~quux/ RewriteRule    ^<strong>foo</strong>\.html$  <strong>bar</strong>.html  [<strong>R</strong>]</div>从静态到动态  描述：  如何无缝转换静态页面<font face="NSimsun">foo.html</font>为动态的<font face="NSimsun">foo.cgi</font>，而不为浏览器/用户所察觉。  解决方案：  只须重写此URL为CGI-script，并强制作为CGI-script运行的MIME类型。比如对<font face="NSimsun">/~quux/foo.html</font>的请求会执行<font face="NSimsun">/~quux/foo.cgi</font> 。<div class="example">RewriteEngine  on RewriteBase    /~quux/ RewriteRule    ^foo\.<strong>html</strong>$  foo.<strong>cgi</strong>  [T=<strong>application/x-httpd-cgi</strong>]</div></div><div class="top"><a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/rewrite/rewrite_guide.html#page-header"><img src="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/images/up.gif" alt="top" /></a></div><div class="section"><a name="access">访问控制</a> 阻止Robot  描述：  如何阻止一个完全匿名的Robot取得特定网络区域的页面？<font face="NSimsun">/robots.txt</font>文件可以包含若干&quot;Robot排除协议&quot;行，但不足以阻止此类Robot。  解决方案：  可以用一个规则集以拒绝对网络区域<font face="NSimsun">/~quux/foo/arc/</font>(对一个很深的目录区域进行列表可能会使服务器产生很大的负载)的访问。还必须确保仅阻止特定的Robot，也就是说，仅仅阻止Robot访问主机是不够的(这样会同时阻止用户访问该主机)。为此，就需要对HTTP头的User-Agent信息作匹配。<div class="example">RewriteCond %{HTTP_USER_AGENT}   ^<strong>NameOfBadRobot</strong>.* RewriteCond %{REMOTE_ADDR}       ^<strong>123\.45\.67\.[8-9]</strong>$ RewriteRule ^<strong>/~quux/foo/arc/</strong>.+   -   [<strong>F</strong>]</div>阻止内嵌的图片  描述：  假设<font face="NSimsun">http://www.quux-corp.de/~quux/</font>有一些内嵌GIF图片的页面，这些图片很好，所以就有人盗链到他们自己的页面中了。由于这样徒然增加了我们服务器的流量，因此，我们不愿意这种事情发生。  解决方案：  虽然，我们不能100%地保护这些图片不被写入别人的页面，但至少可以对发出HTTP Referer头的浏览器加以限制。<div class="example">RewriteCond %{HTTP_REFERER} <strong>!^$</strong> RewriteCond %{HTTP_REFERER} !^http://www.quux-corp.de/~quux/.*$ [NC] RewriteRule <strong>.*\.gif$</strong>        -                                    [F]</div><div class="example">RewriteCond %{HTTP_REFERER}         !^$ RewriteCond %{HTTP_REFERER}         !.*/foo-with-gif\.html$ RewriteRule <strong>^inlined-in-foo\.gif$</strong>   -                        [F]</div>拒绝代理  描述：  如何拒绝某个主机或者来自特定主机的用户使用Apache代理？  解决方案：  首先，要确保在配置文件中<a href="http://www.guagua513seo.com/upload/200904241424221312.gif" alt="top" /></a></div><div class="section"><a name="other">其它</a> 外部重写引擎  描述：  如何解决似乎无法用<a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/mod/mod_rewrite.html"><font face="NSimsun">mod_rewrite</font></a>解决的FOO/BAR/QUUX/之类的问题？  解决方案：  可以使用一个与<a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/mod/mod_rewrite.html#rewritemap"><font face="NSimsun">RewriteMap</font></a>功能相同的外部<a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/mod/mod_rewrite.html#rewritemap"><font face="NSimsun">RewriteMap</font></a>程序，一旦它在Apache启动时被执行，则从<font face="NSimsun">STDIN</font>接收被请求的URL ，并将处理过(通常是重写过的)的URL(以相同顺序)在<font face="NSimsun">STDOUT</font>输出。<div class="example">RewriteEngine on RewriteMap    quux-map       <strong>prg:</strong>/path/to/map.quux.pl RewriteRule   ^/~quux/(.*)$  /~quux/<strong>${quux-map:$1}</strong></div><div class="example">#!/path/to/perl  # 禁止使用会导致Apache陷入死循环的I/O缓冲 $| = 1;  # 从stdin读取URL(每行一个)，并在stdout输出替换URL while (&amp;lt;&gt;) {     s|^foo/|bar/|;     print $_; }</div>这是只是一个简单的示例，只是把所有的<font face="NSimsun">/~quux/foo/...</font>重写为<font face="NSimsun">/~quux/bar/...</font>而已。但事实上，可以把它修改成任何你想要的输出。但是要注意，虽然一般用户都可以<strong>使用</strong>，可是只有系统管理员才可以<strong>定义</strong>这样的映射。</div></div></div></div>]]></description><category>编程与技术</category><comments>http://www.guagua513seo.com/post/34.html#comment</comments><wfw:comment>http://www.guagua513seo.com/</wfw:comment><wfw:commentRss>http://www.guagua513seo.com/feed.asp?cmt=34</wfw:commentRss><trackback:ping>http://www.guagua513seo.com/cmd.asp?act=tb&amp;id=34&amp;key=5c32491e</trackback:ping></item><item><title>&amp;quot;list-style&amp;quot;和“list-style-type”在IE中不显示的问题-guagua513seo博客</title><author>guagua513@163.com (guagua513seo)</author><link>http://www.guagua513seo.com/post/20.html</link><pubDate>Sat, 28 Feb 2009 16:03:29 +0800</pubDate><guid>http://www.guagua513seo.com/post/20.html</guid><description><![CDATA[<p>网页排版时会遇到&quot;list-style&quot;和&ldquo;list-style-type&rdquo;在IE中不显示，而在firfox中正常的问题。经过<a target="_blank" href="http://www.guagua513seo.com">guagua513seo</a>测试, 发现&lt;ul&gt;元素在IE和firfox中有&ldquo;跟随且自动缩进&rdquo;的特性:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当一个&lt;ul&gt;前面有&lt;img&gt;元素且设img的align=&quot;left&quot;时，在IE和Firfox中&quot;list-style&quot;和&ldquo;list-style-type&rdquo;都显示不正常。</p><p>&lt;img src=&quot;../My Documents/My Pictures/20060628195006684.jpg&quot;&nbsp; align=&quot;left&quot;/&gt;<br />&lt;ul class=&quot;tt&quot; &gt;<br />&nbsp; &lt;li&gt;sdfds &lt;/li&gt;<br />&nbsp; &lt;li&gt;sdfsdsf&lt;/li&gt;<br />&nbsp; &lt;li&gt;dsfds &lt;/li&gt;</p><p>IE下面的解决办法是将设置好&lt;ul&gt;的&ldquo;width&rdquo;和&ldquo;padding-left&rdquo;。Padding-left的值应该&gt;=15. 即：</p><p>&lt;style type=&quot;text/css&quot;&gt;<br />ul{ padding-left:15px; width:450px;} &lt;/style&gt;</p><p>或者用&lt;div&gt;将&lt;ul&gt;包住，设置div 为float=&quot;left&quot;,padding-left=15.</p><p>上面第二种方法也适用于firfox.</p>]]></description><category>编程与技术</category><comments>http://www.guagua513seo.com/post/20.html#comment</comments><wfw:comment>http://www.guagua513seo.com/</wfw:comment><wfw:commentRss>http://www.guagua513seo.com/feed.asp?cmt=20</wfw:commentRss><trackback:ping>http://www.guagua513seo.com/cmd.asp?act=tb&amp;id=20&amp;key=4d1eb348</trackback:ping></item></channel></rss>
