<?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>Zack Live</title>
	<atom:link href="http://cn.zacklive.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://cn.zacklive.com</link>
	<description>WordPress 主题设计及网页设计</description>
	<lastBuildDate>Thu, 18 Mar 2010 03:18:04 +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>Google 开发电视机顶盒</title>
		<link>http://cn.zacklive.com/google-developing-tv-set-top-box/181/</link>
		<comments>http://cn.zacklive.com/google-developing-tv-set-top-box/181/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 03:18:04 +0000</pubDate>
		<dc:creator>Zack</dc:creator>
				<category><![CDATA[数码与科技]]></category>
		<category><![CDATA[安卓]]></category>
		<category><![CDATA[机顶盒]]></category>
		<category><![CDATA[电视]]></category>
		<category><![CDATA[索尼]]></category>
		<category><![CDATA[罗技]]></category>
		<category><![CDATA[英特尔]]></category>
		<category><![CDATA[谷歌]]></category>

		<guid isPermaLink="false">http://cn.zacklive.com/?p=181</guid>
		<description><![CDATA[
搜索引擎谷歌（Google）正伙同索尼（Sony），英特尔（Inter）和罗技（Logitech）开发基于安卓（Android）平台的电视机顶盒，意图将网络带到电视上。
在此之前已有很多公司想要将网络与电视结合，但至今未见公认的成功者，谷歌的加入或许能改变这一局面。谷歌的电视机顶盒预计会在未来的几个月内和大家见面，敬请大家一起期待它会为网络与电视市场带来怎样的冲击。
详细内容请看：始者科技新闻杂志。
Related Posts索尼发布自家体感动作控制器：PlayStation Move]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-506" href="http://cn.zacklive.com/?attachment_id=506"><img title="google-tv-set-top-box" src="http://gearor.com/wp-content/uploads/2010/03/google-tv-set-top-box.jpg" alt="google tv set top box Google is Working on TV Set Top Box photo" width="500" height="256" /></a></p>
<p>搜索引擎谷歌（Google）正伙同索尼（Sony），英特尔（Inter）和罗技（Logitech）开发基于安卓（Android）平台的电视机顶盒，意图将网络带到电视上。</p>
<p>在此之前已有很多公司想要将网络与电视结合，但至今未见公认的成功者，谷歌的加入或许能改变这一局面。谷歌的电视机顶盒预计会在未来的几个月内和大家见面，敬请大家一起期待它会为网络与电视市场带来怎样的冲击。</p>
<p><span id="more-181"></span>详细内容请看：<a title="始者科技新聞雜誌" href="http://cn.gearor.com/google-developing-tv-set-top-box/623/">始者科技新闻杂志</a>。</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://cn.zacklive.com/sony-unveiled-its-motion-controller-playstation-move/172/" title="索尼发布自家体感动作控制器：PlayStation Move">索尼发布自家体感动作控制器：PlayStation Move</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://cn.zacklive.com/google-developing-tv-set-top-box/181/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Digg即将推出新版本</title>
		<link>http://cn.zacklive.com/new-digg-released/177/</link>
		<comments>http://cn.zacklive.com/new-digg-released/177/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 03:29:31 +0000</pubDate>
		<dc:creator>Zack</dc:creator>
				<category><![CDATA[网络观察]]></category>
		<category><![CDATA[Digg]]></category>
		<category><![CDATA[推文]]></category>
		<category><![CDATA[新闻网站]]></category>

		<guid isPermaLink="false">http://cn.zacklive.com/?p=177</guid>
		<description><![CDATA[
国际知名推文网站，Digg.com，的行政总裁Jay Adelson公布了Digg一系列重要更新，当中包括个人主页和新的回复系统等。新的Digg将在未来几个礼拜内公开，目前官方已发布了一个新的网址让用户提前体验，有兴趣的朋友可以浏览：New.Digg.com。
详细内容请看：始者科技新闻杂志。
Related PostsGoogle突然推出Google Buzz整合Gmail]]></description>
			<content:encoded><![CDATA[<p><img title="New Digg" src="http://gearor.com/wp-content/uploads/2010/03/new-digg.jpg" alt="new digg Digg即将推出新版本 图片" width="550" height="250" /></p>
<p>国际知名推文网站，Digg.com，的行政总裁<a href="http://en.wikipedia.org/wiki/Jay_Adelson">Jay Adelson</a>公布了Digg一系列重要更新，当中包括个人主页和新的回复系统等。新的Digg将在未来几个礼拜内公开，目前官方已发布了一个新的网址让用户提前体验，有兴趣的朋友可以浏览：<a title="New Digg" href="http://new.digg.com/">New.Digg.com</a>。</p>
<p><span id="more-177"></span>详细内容请看：<a title="始者科技新聞雜誌" href="http://cn.gearor.com/new-digg-released/572/">始者科技新闻杂志</a>。</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://cn.zacklive.com/google-release-google-buzz-integrated-gmail/144/" title="Google突然推出Google Buzz整合Gmail">Google突然推出Google Buzz整合Gmail</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://cn.zacklive.com/new-digg-released/177/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>真实世界的 IPhone 应用程式：冰箱磁铁</title>
		<link>http://cn.zacklive.com/iphone-app-in-real-world-fridge-magnets/174/</link>
		<comments>http://cn.zacklive.com/iphone-app-in-real-world-fridge-magnets/174/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 05:12:43 +0000</pubDate>
		<dc:creator>Zack</dc:creator>
				<category><![CDATA[数码与科技]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[图标]]></category>
		<category><![CDATA[应用程式]]></category>
		<category><![CDATA[设计]]></category>

		<guid isPermaLink="false">http://cn.zacklive.com/?p=174</guid>
		<description><![CDATA[
IPhone 应用程式（Apps）的图标设计美观是大家公认的事，有人把这些漂亮的图标带到真实生活，做成冰箱磁铁。现在你不仅能把iPhone拿在手里，也能把iPhone Apps拿在手掌上。
详细内容请看：始者科技新闻杂志
Popular Posts设计国际化的主题: WordPress主题翻译教学我第二个WordPress主题：BlacknWhiteGoogle Nexus One就是不够酷WordPress 2.9.2 版本发布如何翻译WordPress主题]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a rel="attachment wp-att-493" href="http://cn.zacklive.com/?attachment_id=493"><img class="aligncenter" title="ipone-app-magnets-1" src="http://gearor.com/wp-content/uploads/2010/03/ipone-app-magnets-1.jpg" alt="ipone app magnets 1 Iphone App in Real World: Fridge Magnets photo" width="406" height="500" /></a></p>
<p><a title="iPhone news" href="http://cn.gearor.com/tag/iphone">IPhone</a> <strong>应用程式</strong>（Apps）的图标设计美观是大家公认的事，有人把这些漂亮的<strong>图标</strong>带到真实生活，做成冰箱磁铁。现在你不仅能把iPhone拿在手里，也能把iPhone Apps拿在手掌上。</p>
<p><span id="more-174"></span>详细内容请看：<a title="始者科技新聞雜誌" href="http://cn.gearor.com/sony-unveiled-its-motion-controller-playstation-move/564/">始者科技新闻杂志</a></p>
<h3  class="related_post_title">Popular Posts</h3><ul class="related_post"><li><a href="http://cn.zacklive.com/design-international-wordpress-theme-translation-tutorial/98/" title="设计国际化的主题: WordPress主题翻译教学">设计国际化的主题: WordPress主题翻译教学</a></li><li><a href="http://cn.zacklive.com/second-free-wordpress-theme-blacknwhite/26/" title="我第二个WordPress主题：BlacknWhite">我第二个WordPress主题：BlacknWhite</a></li><li><a href="http://cn.zacklive.com/google-nexus-one-not-cool-enough/92/" title="Google Nexus One就是不够酷">Google Nexus One就是不够酷</a></li><li><a href="http://cn.zacklive.com/wordpress-2-9-2-new-version-released/146/" title="WordPress 2.9.2 版本发布">WordPress 2.9.2 版本发布</a></li><li><a href="http://cn.zacklive.com/poedit-how-to-translate-wordpress-theme/102/" title="如何翻译WordPress主题">如何翻译WordPress主题</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://cn.zacklive.com/iphone-app-in-real-world-fridge-magnets/174/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>索尼发布自家体感动作控制器：PlayStation Move</title>
		<link>http://cn.zacklive.com/sony-unveiled-its-motion-controller-playstation-move/172/</link>
		<comments>http://cn.zacklive.com/sony-unveiled-its-motion-controller-playstation-move/172/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 05:10:43 +0000</pubDate>
		<dc:creator>Zack</dc:creator>
				<category><![CDATA[数码与科技]]></category>
		<category><![CDATA[PlayStation Move]]></category>
		<category><![CDATA[体感]]></category>
		<category><![CDATA[控制器]]></category>
		<category><![CDATA[索尼]]></category>

		<guid isPermaLink="false">http://cn.zacklive.com/?p=172</guid>
		<description><![CDATA[
索尼(Sony)发布自家体感动作控制器(Motion Controller)，定名为PlayStation Move，而不是之前大家猜测的Gem 或 Arc。它由两个控制器组成，其中一个的顶部有个彩色圆球体，目前我们看到有四种颜色。
索尼的官方新闻稿介绍，PlayStation Move同时采用了三轴动作感应、三轴加速感应和重力感应技术，通过与PlayStation Eye的联动，能够对玩家所持手柄操作的绝对位置以及手柄顶部光球的运动轨迹实施准确的捕捉。从而在实现诸如网球游戏中高速的挥拍动作或是书写文字符号等精密动作时发挥更加出色的表现。

详细内容请看始者科技新闻杂志
Related PostsGoogle 开发电视机顶盒]]></description>
			<content:encoded><![CDATA[<p><img title="sony-playstation-move" src="http://gearor.com/wp-content/uploads/2010/03/sony-playstation-move-4.jpg" alt="sony playstation move 4 索尼发布自家体感动作控制器：PlayStation Move 图片" width="620" height="465" /></p>
<p>索尼(Sony)发布自家体感动作控制器(Motion Controller)，定名为PlayStation Move，而不是之前大家猜测的Gem 或 Arc。它由两个控制器组成，其中一个的顶部有个彩色圆球体，目前我们看到有四种颜色。</p>
<blockquote><p>索尼的官方新闻稿介绍，PlayStation Move同时采用了三轴动作感应、三轴加速感应和重力感应技术，通过与PlayStation Eye的联动，能够对玩家所持手柄操作的绝对位置以及手柄顶部光球的运动轨迹实施准确的捕捉。从而在实现诸如网球游戏中高速的挥拍动作或是书写文字符号等精密动作时发挥更加出色的表现。</p></blockquote>
<p><span id="more-172"></span><br />
详细内容请看<a title="始者科技新聞雜誌" href="http://cn.gearor.com/sony-unveiled-its-motion-controller-playstation-move/564/">始者科技新闻杂志</a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://cn.zacklive.com/google-developing-tv-set-top-box/181/" title="Google 开发电视机顶盒">Google 开发电视机顶盒</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://cn.zacklive.com/sony-unveiled-its-motion-controller-playstation-move/172/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>松下电器发布最新Lumix DMC-G2 与 DMC-G10</title>
		<link>http://cn.zacklive.com/panasonic-released-lumix-dmc-g2-and-dmc-g10/169/</link>
		<comments>http://cn.zacklive.com/panasonic-released-lumix-dmc-g2-and-dmc-g10/169/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 09:33:16 +0000</pubDate>
		<dc:creator>Zack</dc:creator>
				<category><![CDATA[数码与科技]]></category>
		<category><![CDATA[DMC-G10]]></category>
		<category><![CDATA[DMC-G2]]></category>
		<category><![CDATA[Lumix]]></category>
		<category><![CDATA[Micro Four Thirds]]></category>
		<category><![CDATA[Panasonic]]></category>
		<category><![CDATA[数码相机]]></category>
		<category><![CDATA[松下电器]]></category>

		<guid isPermaLink="false">http://cn.zacklive.com/?p=169</guid>
		<description><![CDATA[
松下电器（Panasonic）发布了最新的M 3/4 (Micro Four Thirds) 数码相机：G2与G10。两款相机都具有1200万像素的Live Mos镜头，并采用Venus Engine HD第二代技术。G2是G10的高阶版本（数字小的比较高阶），比G10多了可翻转，可触控LCD显示器，最高ISO值可达6400，支持720p AVCHD Lite格式录影。
以下是触控演示影片:
更多内容请到始者数码杂志
Popular Posts设计国际化的主题: WordPress主题翻译教学我第二个WordPress主题：BlacknWhiteGoogle Nexus One就是不够酷WordPress 2.9.2 版本发布如何翻译WordPress主题]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-556" href="http://cn.zacklive.com/?attachment_id=556"><img class="aligncenter size-full wp-image-556" title="panasonic-g2k-micro-four-third" src="http://cn.gearor.com/wp-content/uploads/2010/03/panasonic-g2k-micro-four-third.jpg" alt="panasonic g2k micro four third 松下电器发布最新Lumix DMC G2 与 DMC G10" width="500" height="372" /></a></p>
<p>松下电器（Panasonic）发布了最新的M 3/4 (Micro Four Thirds) 数码相机：G2与G10。两款相机都具有1200万像素的Live Mos镜头，并采用Venus Engine HD第二代技术。G2是G10的高阶版本（数字小的比较高阶），比G10多了可翻转，可触控LCD显示器，最高ISO值可达6400，支持720p AVCHD Lite格式录影。</p>
<p><span id="more-169"></span>以下是触控演示影片:</p>
<p><a href="http://cn.zacklive.com/panasonic-released-lumix-dmc-g2-and-dmc-g10/169/"><em>点击这里查看嵌入的视频。</em></a></p>
<p><a href="http://cn.zacklive.com/panasonic-released-lumix-dmc-g2-and-dmc-g10/169/"><em>点击这里查看嵌入的视频。</em></a></p>
<p>更多内容请到<a href="http://cn.gearor.com/panasonic-released-lumix-dmc-g2-and-dmc-g10/555/" title="始者数码杂志">始者数码杂志</a></p>
<h3  class="related_post_title">Popular Posts</h3><ul class="related_post"><li><a href="http://cn.zacklive.com/design-international-wordpress-theme-translation-tutorial/98/" title="设计国际化的主题: WordPress主题翻译教学">设计国际化的主题: WordPress主题翻译教学</a></li><li><a href="http://cn.zacklive.com/second-free-wordpress-theme-blacknwhite/26/" title="我第二个WordPress主题：BlacknWhite">我第二个WordPress主题：BlacknWhite</a></li><li><a href="http://cn.zacklive.com/google-nexus-one-not-cool-enough/92/" title="Google Nexus One就是不够酷">Google Nexus One就是不够酷</a></li><li><a href="http://cn.zacklive.com/wordpress-2-9-2-new-version-released/146/" title="WordPress 2.9.2 版本发布">WordPress 2.9.2 版本发布</a></li><li><a href="http://cn.zacklive.com/poedit-how-to-translate-wordpress-theme/102/" title="如何翻译WordPress主题">如何翻译WordPress主题</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://cn.zacklive.com/panasonic-released-lumix-dmc-g2-and-dmc-g10/169/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>为WordPress选择程式码显示插件</title>
		<link>http://cn.zacklive.com/choose-right-syntax-highlight-plugin-for-wordpress/167/</link>
		<comments>http://cn.zacklive.com/choose-right-syntax-highlight-plugin-for-wordpress/167/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 09:32:13 +0000</pubDate>
		<dc:creator>Zack</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress插件]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[程式码]]></category>
		<category><![CDATA[高亮显示]]></category>

		<guid isPermaLink="false">http://cn.zacklive.com/?p=167</guid>
		<description><![CDATA[
刚开始我只用引用（Quote）来显示程式码，随着程式码越来越多，引用已经不够用，我决定要加个程式码高亮显示的插件到WordPress里。
我前后共测试了5个这种插件，包括：

SyntaxHighlighter Plus
WP-Syntax
Google Syntax Highlighter for WordPress
Syntax Highlighter for WordPress
SyntaxHighlighter Evolved

我也总结出，具体的要求：

不用修改WordPress，包括主题：我不希望因为一个插件而修改WordPress或主题，特别是有其他的选择的情况下。
显示行数：有行数的话，当讨论程式码时，就比较容易去指定特定一行。关于这一点，WP-Syntax预设是不显示行数的，所以我没有选择它。
支持可视化编辑器（Visual Editor）：这是最严重的问题，有些插件在Visual Editor里会自动重编程式码以便在HTML下显示，这样会破坏原程式码，导致每次编辑时都要改程式码，改到我火都上来。SyntaxHighlighter Plus，Google Syntax Highlighter for WordPress和Syntax Highlighter for WordPress都有这个问题。

剩下的就是SyntaxHighlighter Evolved，它是唯一不需要作任何改动就符合以上要求，也支持所有常用的程式语言，包括PHP, HTML, CSS, C等。使用上也很简单，只要用[语言]和[/语言]来包住程式码，其中语言是程式码相应的程式语言，如PHP。该插件也有设置页面，可以做一些细节的微调，也有一些使用说明可以参考。以下是一个带有PHP的HTML范例：

&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Strict//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&#34;&#62;
&#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34; xml:lang=&#34;en&#34; lang=&#34;en&#34;&#62;
&#60;head&#62;
	&#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=UTF-8&#34; /&#62;
	&#60;title&#62;PHP Code Example&#60;/title&#62;
&#60;/head&#62;
&#60;body&#62;
	&#60;h1&#62;PHP Code Example&#60;/h1&#62;

	&#60;p&#62;&#60;?php echo 'Hello World!'; ?&#62;&#60;/p&#62;

	&#60;p&#62;This line is highlighted.&#60;/p&#62;

	&#60;div class=&#34;foobar&#34;&#62;
		This	is	an
		example	of	smart
		tabs.
	&#60;/div&#62;

	&#60;p&#62;&#60;a href=&#34;http://wordpress.org/&#34;&#62;WordPress&#60;/a&#62;&#60;/p&#62;
&#60;/body&#62;
&#60;/html&#62;

Related PostsWordPress 2.9.2 版本发布高亮(Hightlight)显示作者回覆设计国际化的主题: WordPress主题翻译教学不用WordPress, [...]]]></description>
			<content:encoded><![CDATA[<p><img alt="syntaxhighlighter evolved 为WordPress选择程式码显示插件" src="http://zacklive.com/wp-content/uploads/2010/03/syntaxhighlighter-evolved.jpg" title="syntaxhighlighter-evolved" class="aligncenter" width="550" height="250" /></p>
<p>刚开始我只用引用（Quote）来显示程式码，随着程式码越来越多，引用已经不够用，我决定要加个程式码高亮显示的插件到WordPress里。</p>
<p>我前后共测试了5个这种插件，包括：</p>
<ul>
<li><a title="SyntaxHighlighter Plus" href="http://zacklive.com/choose-a-syntax-highlighter-plugin-for-wordpress/926/SyntaxHighlighter%20Plus">SyntaxHighlighter Plus</a></li>
<li><a title="WP-Syntax" href="http://wordpress.org/extend/plugins/wp-syntax/">WP-Syntax</a></li>
<li><a title="Google Syntax Highlighter for WordPress" href="http://wordpress.org/extend/plugins/google-syntax-highlighter/">Google Syntax Highlighter for WordPress</a></li>
<li><a title="Syntax Highlighter for WordPress" href="http://wordpress.org/extend/plugins/syntax-highlighter/">Syntax Highlighter for WordPress</a></li>
<li><a title="SyntaxHighlighter Evolved" href="http://wordpress.org/extend/plugins/syntaxhighlighter/">SyntaxHighlighter Evolved</a></li>
</ul>
<p>我也总结出，具体的要求：</p>
<ol>
<li>不用修改WordPress，包括主题：我不希望因为一个插件而修改WordPress或主题，特别是有其他的选择的情况下。</li>
<li>显示行数：有行数的话，当讨论程式码时，就比较容易去指定特定一行。关于这一点，WP-Syntax预设是不显示行数的，所以我没有选择它。</li>
<li>支持可视化编辑器（Visual Editor）：这是最严重的问题，有些插件在Visual Editor里会自动重编程式码以便在HTML下显示，这样会破坏原程式码，导致每次编辑时都要改程式码，改到我火都上来。SyntaxHighlighter Plus，Google Syntax Highlighter for WordPress和Syntax Highlighter for WordPress都有这个问题。</li>
</ol>
<p><span id="more-167"></span>剩下的就是SyntaxHighlighter Evolved，它是唯一不需要作任何改动就符合以上要求，也支持所有常用的程式语言，包括PHP, HTML, CSS, C等。使用上也很简单，只要用[语言]和[/语言]来包住程式码，其中语言是程式码相应的程式语言，如PHP。该插件也有设置页面，可以做一些细节的微调，也有一些使用说明可以参考。以下是一个带有PHP的HTML范例：</p>
<pre class="brush: php; html-script: true;">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;
&lt;head&gt;
	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
	&lt;title&gt;PHP Code Example&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;h1&gt;PHP Code Example&lt;/h1&gt;

	&lt;p&gt;&lt;?php echo 'Hello World!'; ?&gt;&lt;/p&gt;

	&lt;p&gt;This line is highlighted.&lt;/p&gt;

	&lt;div class=&quot;foobar&quot;&gt;
		This	is	an
		example	of	smart
		tabs.
	&lt;/div&gt;

	&lt;p&gt;&lt;a href=&quot;http://wordpress.org/&quot;&gt;WordPress&lt;/a&gt;&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://cn.zacklive.com/wordpress-2-9-2-new-version-released/146/" title="WordPress 2.9.2 版本发布">WordPress 2.9.2 版本发布</a></li><li><a href="http://cn.zacklive.com/wordpress-hightlight-author-comments/119/" title="高亮(Hightlight)显示作者回覆">高亮(Hightlight)显示作者回覆</a></li><li><a href="http://cn.zacklive.com/design-international-wordpress-theme-translation-tutorial/98/" title="设计国际化的主题: WordPress主题翻译教学">设计国际化的主题: WordPress主题翻译教学</a></li><li><a href="http://cn.zacklive.com/wordpress-professional-blog/88/" title="不用WordPress, 你的网志就不够专业">不用WordPress, 你的网志就不够专业</a></li><li><a href="http://cn.zacklive.com/second-free-wordpress-theme-blacknwhite/26/" title="我第二个WordPress主题：BlacknWhite">我第二个WordPress主题：BlacknWhite</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://cn.zacklive.com/choose-right-syntax-highlight-plugin-for-wordpress/167/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>根据浏览器语言重定向访客</title>
		<link>http://cn.zacklive.com/redirect-users-according-to-browser-language/164/</link>
		<comments>http://cn.zacklive.com/redirect-users-according-to-browser-language/164/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 04:47:58 +0000</pubDate>
		<dc:creator>Zack</dc:creator>
				<category><![CDATA[网页设计]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[多国语言]]></category>
		<category><![CDATA[转向]]></category>
		<category><![CDATA[重定向]]></category>

		<guid isPermaLink="false">http://cn.zacklive.com/?p=164</guid>
		<description><![CDATA[
最近我开了一个新网站，Gearor.com，以报导科技新闻为主。我为这个网站设计了中文（cn.gearor.com）及英文版本，所以我希望做到，当用户访问时，判断用户是否使用中文浏览器，若是便将用户带到中文页面。
一开头，我直观地在主页将所有中文浏览器转到中文页面。这样做有一个问题：就是在中文页面内，我放置了一条返回英文页面的连结，若中文用户想看英文内容，可按此连结。当我加入转向程式，即使点击了这条连结，还是会被带回到中文页面，变成中文用户到不了英文的主页，这是不能接受的。
解决的方法也不难，只要在转向程式加入判断，不对来源网站为本站的用户进行转向。问题是要实现这个方法却不容易，我试过JavaScript，亦试过用SESSION的方法，都未能满足。最后我将问题放到StockOverFlow上，终于找到满意的解决方法。顺带一提，StockOverFlow真是一个非常棒的网站，那里有大量优秀的程式员，而且大家都很乐意为你解答疑问。以下是我修改过的程式，目前在Gearor.com上使用：

if (!preg_match('%gearor.com%i', $_SERVER['HTTP_REFERER']))
	{
		if (!preg_match('%cn.gearor.com%i', $_SERVER['HTTP_REFERER']))
		{
			if (preg_match('/zh-cn/i', $_SERVER['HTTP_ACCEPT_LANGUAGE']))
				wp_redirect('http://cn.gearor.com');
		}
	}

如果你也在设计多国语言网站，或许这段程式也能帮到你，当然，若你有更好的方法，欢迎与我分享。
Related Posts安装Kohana 3 PHP 框架PHP防止SQL Injection: Addslashes还是Mysql_real_escape_string面向对象PHP教学：MySQL数据库应用]]></description>
			<content:encoded><![CDATA[<p><img alt="gearor gadgets tech mag 根据浏览器语言重定向访客" src="http://zacklive.com/wp-content/uploads/2010/03/gearor-gadgets-tech-mag.jpg" title="Gearor Gadgets Magazine" class="aligncenter" width="550" height="250" /></p>
<p>最近我开了一个新网站，<a href="http://gearor.com" title="Gearor科技新闻">Gearor.com</a>，以报导科技新闻为主。我为这个网站设计了中文（cn.gearor.com）及英文版本，所以我希望做到，当用户访问时，判断用户是否使用中文浏览器，若是便将用户带到中文页面。</p>
<p>一开头，我直观地在主页将所有中文浏览器转到中文页面。这样做有一个问题：就是在中文页面内，我放置了一条返回英文页面的连结，若中文用户想看英文内容，可按此连结。当我加入转向程式，即使点击了这条连结，还是会被带回到中文页面，变成中文用户到不了英文的主页，这是不能接受的。</p>
<p><span id="more-164"></span>解决的方法也不难，只要在转向程式加入判断，不对来源网站为本站的用户进行转向。问题是要实现这个方法却不容易，我试过JavaScript，亦试过用SESSION的方法，都未能满足。最后我将问题放到<a href="http://stackoverflow.com/">StockOverFlow</a>上，终于找到满意的解决方法。顺带一提，<strong>StockOverFlow</strong>真是一个非常棒的网站，那里有大量优秀的程式员，而且大家都很乐意为你解答疑问。以下是我修改过的程式，目前在Gearor.com上使用：</p>
<pre class="brush: php;">
if (!preg_match('%gearor.com%i', $_SERVER['HTTP_REFERER']))
	{
		if (!preg_match('%cn.gearor.com%i', $_SERVER['HTTP_REFERER']))
		{
			if (preg_match('/zh-cn/i', $_SERVER['HTTP_ACCEPT_LANGUAGE']))
				wp_redirect('http://cn.gearor.com');
		}
	}
</pre>
<p>如果你也在设计多国语言网站，或许这段程式也能帮到你，当然，若你有更好的方法，欢迎与我分享。</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://cn.zacklive.com/install-kohana-3-php-framework-2/162/" title="安装Kohana 3 PHP 框架">安装Kohana 3 PHP 框架</a></li><li><a href="http://cn.zacklive.com/php-avoid-sql-injection-addslashes-mysql-real-escape-strin/155/" title="PHP防止SQL Injection: Addslashes还是Mysql_real_escape_string">PHP防止SQL Injection: Addslashes还是Mysql_real_escape_string</a></li><li><a href="http://cn.zacklive.com/object-oriented-programming-php-mysql/149/" title="面向对象PHP教学：MySQL数据库应用">面向对象PHP教学：MySQL数据库应用</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://cn.zacklive.com/redirect-users-according-to-browser-language/164/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>安装Kohana 3 PHP 框架</title>
		<link>http://cn.zacklive.com/install-kohana-3-php-framework-2/162/</link>
		<comments>http://cn.zacklive.com/install-kohana-3-php-framework-2/162/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 03:44:02 +0000</pubDate>
		<dc:creator>Zack</dc:creator>
				<category><![CDATA[网页设计]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[Kohana]]></category>
		<category><![CDATA[Kohana 3]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[安装]]></category>
		<category><![CDATA[教学]]></category>
		<category><![CDATA[设计模式]]></category>

		<guid isPermaLink="false">http://cn.zacklive.com/?p=162</guid>
		<description><![CDATA[
Kohana 3发布已经有一段时间，这个版本重新设计了大量的代码，其实最重要的改变是用HMVC设计模式取代MVC。至于什么是HMVC？以下几篇文章或许能帮大家理解：

浅谈HMVC模式
谈谈HMVC
说说HMVC

另外，虽然Kohana 3发布了，但Kohana 2还是会继续发展，原Kohana 2的用户可以放心继续使用。如果你是刚学Kohana的话，建议还是学Kohana 3。
和以往一样，Kohana 3的安装非常容易。这里可以下载Kohana 3。解压后，将Kohana文件夹上传到你的网站，当然你可以将文件夹改为任何你喜欢的名字。再来需要改一下权限，请将以下文件夹的权限改为777：

application/cache
application/logs

最后再对application/bootstrap.php作小许设定：

更改 timezone
设定 base_url

到这里，Kohana 3的安装与设定就完成了，我们现在可以访问Kohana页面，在浏览器中输入Kohana所在位置，也就是刚刚设的base_url，你会看到如下画面：

能看到这个画面，代表一切正常。注意中间绿色文字提示你要删除install.php文件，删除后刷新这个页面，会变成显示文字：&#8221;hello, world!&#8221;这是预设的Controller输出的文字，那这个Controller在哪里呢？请打开application-&#62;classes-&#62;controller，你会看到一个welcome.php，就是它了，以下是它的代码：

&#60;?php defined('SYSPATH') or die('No direct script access.');

class Controller_Welcome extends Controller {

	public function action_index()
	{
		$this-&#62;request-&#62;response = 'hello, world!';
	}

} // End Welcome

这个Controller唯一个的事就是输出文字：hello, world! 你可以试着做一些修改，将这一行：

$this-&#62;request-&#62;response = 'hello, world!';

改为：

$this-&#62;request-&#62;response = 'hello, Kohana 3! I am Zack from ZackLive.com~';

之类的，再刷刚才的页面，看看有什么变化。
以下Kohana 3相关资源：

Kohana 3 用户手册
Kohana 3 非官方维基
Kohana 3 API 资料

如果你有任何关于Kohana的疑问可以在这里回覆提出或到Kohana官方讨论区提问。
Related Posts面向对象PHP教学：MySQL数据库应用根据浏览器语言重定向访客PHP防止SQL Injection: Addslashes还是Mysql_real_escape_string进阶WordPress主题翻译技巧设计国际化的主题: [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter" title="kohana-3-php-logo" src="http://zacklive.com/wp-content/uploads/2010/02/kohana-3-php-logo-550x241.jpg" alt="kohana 3 php logo 550x241 安装Kohana 3 PHP 框架" width="550" height="241" /><br />
Kohana 3发布已经有一段时间，这个版本重新设计了大量的代码，其实最重要的改变是用HMVC设计模式取代MVC。至于什么是HMVC？以下几篇文章或许能帮大家理解：</p>
<ol>
<li><a title="浅谈HMVC模式" href="http://xhp5678.cnblogs.com/archive/2005/10/31/265245.html">浅谈HMVC模式</a></li>
<li><a title="谈谈HMVC" href="http://lsvking.cn/794">谈谈HMVC</a></li>
<li><a title="说说HMVC" href="http://lzyy.org/blog/archives/107">说说HMVC</a></li>
</ol>
<p>另外，虽然Kohana 3发布了，但Kohana 2还是会继续发展，原Kohana 2的用户可以放心继续使用。如果你是刚学Kohana的话，建议还是学Kohana 3。</p>
<p>和以往一样，Kohana 3的安装非常容易。这里可以<a href="http://dev.kohanaphp.com/projects/kohana3/files">下载Kohana 3</a>。解压后，将Kohana文件夹上传到你的网站，当然你可以将文件夹改为任何你喜欢的名字。再来需要改一下权限，请将以下文件夹的权限改为777：</p>
<ol>
<li>application/cache</li>
<li>application/logs</li>
</ol>
<p><span id="more-162"></span>最后再对application/bootstrap.php作小许设定：</p>
<ol>
<li>更改 <a href="http://php.net/timezones">timezone</a></li>
<li>设定 base_url</li>
</ol>
<p style="text-align: center;">到这里，Kohana 3的安装与设定就完成了，我们现在可以访问Kohana页面，在浏览器中输入Kohana所在位置，也就是刚刚设的base_url，你会看到如下画面：<br />
<a href="http://zacklive.com/wp-content/uploads/2010/02/kohana-install-1.jpg"><img class="aligncenter" title="Kohana Installation" src="http://zacklive.com/wp-content/uploads/2010/02/kohana-install-1.jpg" alt="kohana install 1 安装Kohana 3 PHP 框架" height="550" /></a></p>
<p>能看到这个画面，代表一切正常。注意中间绿色文字提示你要删除install.php文件，删除后刷新这个页面，会变成显示文字：&#8221;hello, world!&#8221;这是预设的Controller输出的文字，那这个Controller在哪里呢？请打开application-&gt;classes-&gt;controller，你会看到一个welcome.php，就是它了，以下是它的代码：</p>
<pre class="brush: php;">
&lt;?php defined('SYSPATH') or die('No direct script access.');

class Controller_Welcome extends Controller {

	public function action_index()
	{
		$this-&gt;request-&gt;response = 'hello, world!';
	}

} // End Welcome
</pre>
<p>这个Controller唯一个的事就是输出文字：hello, world! 你可以试着做一些修改，将这一行：</p>
<pre class="brush: php;">
$this-&gt;request-&gt;response = 'hello, world!';
</pre>
<p>改为：</p>
<pre class="brush: php;">
$this-&gt;request-&gt;response = 'hello, Kohana 3! I am Zack from ZackLive.com~';
</pre>
<p>之类的，再刷刚才的页面，看看有什么变化。</p>
<p>以下Kohana 3相关资源：</p>
<ol>
<li><a title="Kohana 3 用户手册" href="http://v3.kohanaphp.com/guide/about.kohana">Kohana 3 用户手册</a></li>
<li><a title="Kohana 3 非官方维基" href="http://kerkness.ca/wiki/doku.php">Kohana 3 非官方维基</a></li>
<li><a title="Kohana 3 API 资料" href="http://kohana.sher.pl/cs">Kohana 3 API 资料</a></li>
</ol>
<p>如果你有任何关于Kohana的疑问可以在这里回覆提出或到<a title="Kohana官方讨论区" href="http://forum.kohanaphp.com/">Kohana官方讨论区</a>提问。</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://cn.zacklive.com/object-oriented-programming-php-mysql/149/" title="面向对象PHP教学：MySQL数据库应用">面向对象PHP教学：MySQL数据库应用</a></li><li><a href="http://cn.zacklive.com/redirect-users-according-to-browser-language/164/" title="根据浏览器语言重定向访客">根据浏览器语言重定向访客</a></li><li><a href="http://cn.zacklive.com/php-avoid-sql-injection-addslashes-mysql-real-escape-strin/155/" title="PHP防止SQL Injection: Addslashes还是Mysql_real_escape_string">PHP防止SQL Injection: Addslashes还是Mysql_real_escape_string</a></li><li><a href="http://cn.zacklive.com/advanced-wordpress-themes-translation/106/" title="进阶WordPress主题翻译技巧">进阶WordPress主题翻译技巧</a></li><li><a href="http://cn.zacklive.com/design-international-wordpress-theme-translation-tutorial/98/" title="设计国际化的主题: WordPress主题翻译教学">设计国际化的主题: WordPress主题翻译教学</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://cn.zacklive.com/install-kohana-3-php-framework-2/162/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP防止SQL Injection: Addslashes还是Mysql_real_escape_string</title>
		<link>http://cn.zacklive.com/php-avoid-sql-injection-addslashes-mysql-real-escape-strin/155/</link>
		<comments>http://cn.zacklive.com/php-avoid-sql-injection-addslashes-mysql-real-escape-strin/155/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 07:06:46 +0000</pubDate>
		<dc:creator>Zack</dc:creator>
				<category><![CDATA[网页设计]]></category>
		<category><![CDATA[addslashes]]></category>
		<category><![CDATA[magic_quotes_gpc]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql_real_escape_string]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SQL Injection]]></category>

		<guid isPermaLink="false">http://cn.zacklive.com/?p=155</guid>
		<description><![CDATA[
最近看了几篇关于防止SQL Injection的文章，跟大家分享一下我学到的东西。
PHP防止SQL Injection主要有两种做法，分别应用两个函数：addslashes()和mysql_real_escape_string()。早期一般用addslashes()，现在主要用mysql_real_escape_string()，这两个有什么分别呢？Alan Storm 作了以下的解释：
PHP’s mysql_real_escape_string function will, more or less, ask mysql what character(s) needs to be escaped, where the addslashses function will just add a backslash in front of and any single quote (‘), double quote (“), backslash (\) or NUL (the NULL byte) character.
我翻译如下：
PHP的mysql_real_escape_string函数会分析哪些字元需要进行处理，而addslashes则单纯对所有的单引号(‘)，双引号(“)，反斜线(\)和NUL字元加入反斜线。
在同一篇文章中，Waage说（翻译）：

mysql_real_escape_string会为以下字元加入反斜线：
\x00, \n, \r, \, &#8216;, &#8221; 和 \x1a. characters.
而addslash只为以下字元加反斜线：
&#8216; \ [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://zacklive.com/wp-content/uploads/2010/02/SQL-Injection.jpg" alt="SQL Injection PHP防止SQL Injection: Addslashes还是Mysql real escape string" title="SQL-Injection" width="550" height="250" class="aligncenter size-full wp-image-907" /><br />
最近看了几篇关于<strong>防止SQL Injection</strong>的文章，跟大家分享一下我学到的东西。</p>
<p><strong>PHP防止SQL Injection</strong>主要有两种做法，分别应用两个函数：<em>addslashes</em>()和<em>mysql_real_escape_string</em>()。早期一般用<em>addslashes</em>()，现在主要用<em>mysql_real_escape_string</em>()，这两个有什么分别呢？<a title="addslashes or mysql_real_escape_string" href="http://stackoverflow.com/questions/534742/what-does-mysql-real-escape-string-do-that-addslashes-doesnt">Alan Storm</a> 作了以下的解释：</p>
<blockquote><p>PHP’s mysql_real_escape_string function will, more or less, <strong>ask mysql what character(s) needs to be escaped</strong>, where the addslashses function will just add a backslash in front of and any single quote (‘), double quote (“), backslash (\) or NUL (the NULL byte) character.</p></blockquote>
<p>我翻译如下：</p>
<blockquote><p>PHP的<em>mysql_real_escape_string</em>函数会分析哪些字元需要进行处理，而<em>addslashes</em>则单纯对所有的单引号(‘)，双引号(“)，反斜线(\)和NUL字元加入反斜线。</p></blockquote>
<p>在同一篇文章中，Waage说（翻译）：</p>
<blockquote><p>
mysql_real_escape_string会为以下字元加入反斜线：<br />
\x00, \n, \r, \, &#8216;, &#8221; 和 \x1a. characters.<br />
而addslash只为以下字元加反斜线：<br />
&#8216; \ and NUL
</p></blockquote>
<p><span id="more-155"></span>如此看来，<em>mysql_real_escape_string</em>会比<em>addslashes</em>更安全。但如果你坚持要用addslashes的话，可以参考以下来自<a href="http://www.php5.idv.tw/modules.php?mod=books&#038;act=show&#038;shid=2475" title="PHP Addslashes SQL Injection">php5.idv.tw</a>的程式：</p>
<pre class="brush: php;">
function quotes($content)
{
	//if magic_quotes_gpc=Off
	if (!get_magic_quotes_gpc())
	{
		//if $content is an array
		if (is_array($content))
		{
			foreach ($content as $key=&gt;$value)
			{
				$content[$key] = addslashes($value);
			}
		} else
		{
			//if $content is not an array
			addslashes($content);
		}
	} else
	{
		//if magic_quotes_gpc=On do nothing
	}
	return $content;
}
</pre>
<p>这个程式首先会检查<strong>magic_quotes_gpc</strong>是否开启，由于<strong>magic_quotes_gpc</strong>的功能和<em>addslashes</em>()重覆，所以，我们只在<strong>magic_quotes_gpc</strong>关闭时才做<em>addslashes</em>()处理。进行<em>addslashes</em>()时，再分别处理数组与非数组数据。</p>
<p>当然，你也可以参照以上的程式，做一个<em>mysql_real_escape_string</em>()的版本。以下是我的版本：</p>
<pre class="brush: php;">
function quotes($content)
{
	//if $content is an array
	if (is_array($content))
	{
		foreach ($content as $key=&gt;$value)
		{
			$content[$key] = mysql_real_escape_string($value);
		}
	} else
	{
		//if $content is not an array
		mysql_real_escape_string($content);
	}
	return $content;
}
</pre>
<p>几乎是一样，只是除去了<strong>magic_quotes_gpc</strong>的判断，再将<em>addslashes</em>换成<em>mysql_real_escape_string</em>。你可以参考以下例子使用这个函数：</p>
<pre class="brush: php;">
$name = quotes($_POST['user']);
$password = quotes($_POST['password']);
</pre>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://cn.zacklive.com/object-oriented-programming-php-mysql/149/" title="面向对象PHP教学：MySQL数据库应用">面向对象PHP教学：MySQL数据库应用</a></li><li><a href="http://cn.zacklive.com/redirect-users-according-to-browser-language/164/" title="根据浏览器语言重定向访客">根据浏览器语言重定向访客</a></li><li><a href="http://cn.zacklive.com/install-kohana-3-php-framework-2/162/" title="安装Kohana 3 PHP 框架">安装Kohana 3 PHP 框架</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://cn.zacklive.com/php-avoid-sql-injection-addslashes-mysql-real-escape-strin/155/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>通用CSS样式表模版</title>
		<link>http://cn.zacklive.com/general-master-css-stylesheet/152/</link>
		<comments>http://cn.zacklive.com/general-master-css-stylesheet/152/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 08:19:37 +0000</pubDate>
		<dc:creator>Zack</dc:creator>
				<category><![CDATA[网页设计]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Master Stylesheet]]></category>
		<category><![CDATA[样式表]]></category>
		<category><![CDATA[模版]]></category>

		<guid isPermaLink="false">http://cn.zacklive.com/?p=152</guid>
		<description><![CDATA[
每次设计一个新的网站，我们都要写一个新的CSS样式表，而当中的内容有很多是跟以往的设计类似，甚至一样，像是blockqoute, &#60;h1&#62;至&#60;h6&#62;等设定。因此，我一直想要整理出一个通用的CSS样式表模版(Master Stylesheet)，里面包含一些最基本最常用的CSS设定。当开始设计一个新网站的时候，我们首先载入这个模版，就能马上完成了基本的设计，接下来，只要针对这个网站进行细节的设计，如果模版的设定不适合新网站，可以在新网站的CSS文件重写，CSS会自动覆盖模版的设定。
假设我们把模版命名为master.css，而网站的CSS文件为style.css，那我们可以在style.css开头加入以下语句，即可将模版导入：

@import &#34;master.css&#34;;

现在的问题是这个模版要怎么写呢？最近看到了Kyle写的一篇：Master Stylesheet: The Most Useful CSS Technique，是我见过最完整的Master Stylesheet，很多的细节都被考虑到了，直接就能使用。我唯一增加的一段程式码就是在Andrew那里看到的用于重设浏览器设定：

* {
	padding:0;
	margin:0;
}

以下是完整的master.css文件：

/***** Browser Settings *****/
* {
	padding:0;
	margin:0;
}
/***** Global Settings *****/

html, body {
border:0;
margin:0;
padding:0;
}

body {
font:100%/1.25 Arial, Helvetica, sans-serif;
}

/***** Headings *****/

h1, h2, h3, h4, h5, h6 {
margin:0;
padding:0;
font-weight:normal;
font-family: Arial, Helvetica, sans-serif;
}

h1 {
padding:30px 0 25px 0;
letter-spacing:-1px;
font-size:2em;
}

h2 {
padding:20px 0;
letter-spacing:-1px;
font-size:1.5em;
}

h3 {
font-size:1em;
font-weight:bold;
}

/***** Common Formatting *****/

p, ul, ol {
margin:0;
padding:0 0 1.25em 0;
}

ul, ol {
padding:0 0 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chinese.zacklive.com/wp-content/uploads/2010/02/CSSEditLogo.png"><img src="http://chinese.zacklive.com/wp-content/uploads/2010/02/CSSEditLogo.png" alt="CSSEditLogo 通用CSS样式表模版" title="CSS Master Stylesheet" width="400" height="400" class="aligncenter size-full wp-image-156" /></a><br />
每次设计一个新的网站，我们都要写一个新的CSS样式表，而当中的内容有很多是跟以往的设计类似，甚至一样，像是blockqoute, &lt;h1&gt;至&lt;h6&gt;等设定。因此，我一直想要整理出一个通用的CSS样式表模版(Master Stylesheet)，里面包含一些最基本最常用的CSS设定。当开始设计一个新网站的时候，我们首先载入这个模版，就能马上完成了基本的设计，接下来，只要针对这个网站进行细节的设计，如果模版的设定不适合新网站，可以在新网站的CSS文件重写，CSS会自动覆盖模版的设定。</p>
<p>假设我们把模版命名为master.css，而网站的CSS文件为style.css，那我们可以在style.css开头加入以下语句，即可将模版导入：</p>
<pre class="brush: css;">
@import &quot;master.css&quot;;
</pre>
<p><span id="more-152"></span>现在的问题是这个模版要怎么写呢？最近看到了Kyle写的一篇：<a title="Master Stylesheet: The Most Useful CSS Technique" href="http://www.crucialwebhost.com/blog/master-stylesheet-the-most-useful-css-technique/">Master Stylesheet: The Most Useful CSS Technique</a>，是我见过最完整的Master Stylesheet，很多的细节都被考虑到了，直接就能使用。我唯一增加的一段程式码就是在<a title="CSS Global Reset" href="http://leftjustified.net/journal/2004/10/19/global-ws-reset/">Andrew</a>那里看到的用于重设浏览器设定：</p>
<pre class="brush: css;">
* {
	padding:0;
	margin:0;
}
</pre>
<p>以下是完整的master.css文件：</p>
<pre class="brush: css;">
/***** Browser Settings *****/
* {
	padding:0;
	margin:0;
}
/***** Global Settings *****/

html, body {
border:0;
margin:0;
padding:0;
}

body {
font:100%/1.25 Arial, Helvetica, sans-serif;
}

/***** Headings *****/

h1, h2, h3, h4, h5, h6 {
margin:0;
padding:0;
font-weight:normal;
font-family: Arial, Helvetica, sans-serif;
}

h1 {
padding:30px 0 25px 0;
letter-spacing:-1px;
font-size:2em;
}

h2 {
padding:20px 0;
letter-spacing:-1px;
font-size:1.5em;
}

h3 {
font-size:1em;
font-weight:bold;
}

/***** Common Formatting *****/

p, ul, ol {
margin:0;
padding:0 0 1.25em 0;
}

ul, ol {
padding:0 0 1.25em 2.5em;
}

blockquote {
margin:1.25em;
padding:1.25em 1.25em 0 1.25em;
}

small {
font-size:0.85em;
}

img {
border:0;
}

sup {
position:relative;
bottom:0.3em;
vertical-align:baseline;
}

sub {
position:relative;
bottom:-0.2em;
vertical-align:baseline;
}

acronym, abbr {
cursor:help;
letter-spacing:1px;
border-bottom:1px dashed;
}

/***** Links *****/

a,
a:link,
a:visited,
a:hover {
text-decoration:underline;
}

/***** Forms *****/

form {
margin:0;
padding:0;
display:inline;
}

input, select, textarea {
font:1em Arial, Helvetica, sans-serif;
}

textarea {
width:100%;
line-height:1.25;
}

label {
cursor:pointer;
}

/***** Tables *****/

table {
border:0;
margin:0 0 1.25em 0;
padding:0;
}

table tr td {
padding:2px;
}

/***** Wrapper *****/

#wrap {
width:960px;
margin:0 auto;
}

/***** Global Classes *****/

.clear         { clear:both; }
.float-left    { float:left; }
.float-right   { float:right; }

.text-left     { text-align:left; }
.text-right    { text-align:right; }
.text-center   { text-align:center; }
.text-justify  { text-align:justify; }

.bold          { font-weight:bold; }
.italic        { font-style:italic; }
.underline     { border-bottom:1px solid; }
.highlight     { background:#ffc; }

.img-left      { float:left;margin:4px 10px 4px 0; }
.img-right     { float:right;margin:4px 0 4px 10px; }

.nopadding     { padding:0; }
.noindent      { margin-left:0;padding-left:0; }
.nobullet      { list-style:none;list-style-image:none; }
</pre>
<p>我准备以此作为第一个版本，未来学到新的技巧，再加入，持续强化它。</p>
<p>另外，这里还有一篇关于Master Stylesheet的教学，有兴趣的朋友请点<a href="http://webdesign.about.com/od/css/a/master_stylesht.htm" title="CSS master stylesheet">这里</a>。</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://cn.zacklive.com/jquery-milti-level-drop-down-menu-wordpress/122/" title="使用JQuery实现WordPress多层下拉导航">使用JQuery实现WordPress多层下拉导航</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://cn.zacklive.com/general-master-css-stylesheet/152/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
