<?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>Leeiio Chaos Made. &#187; 自動換行</title>
	<atom:link href="http://leeiio.me/tag/%e8%87%aa%e5%8b%95%e6%8f%9b%e8%a1%8c/feed/" rel="self" type="application/rss+xml" />
	<link>http://leeiio.me</link>
	<description>The world is golden.</description>
	<lastBuildDate>Thu, 26 Apr 2012 03:54:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>讓你的 pre 标签能自動換行</title>
		<link>http://leeiio.me/pre-wrap/</link>
		<comments>http://leeiio.me/pre-wrap/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 17:06:24 +0000</pubDate>
		<dc:creator>Leeiio</dc:creator>
				<category><![CDATA[Skill | 技术]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[自動換行]]></category>
		<category><![CDATA[pre]]></category>

		<guid isPermaLink="false">http://blog.guaniu.com/?p=572</guid>
		<description><![CDATA[最近發了很多都要貼代碼的文，我貼代碼用的插件是Wp-Codebox，另外我也比對過其他的一些插件諸如WP-Syntax和SyntaxHighlighter。這些插件被解析出來後無非就是&#60;pre&#62;&#60;/pre&#62;。但是有個問題就是有時候貼的代碼過長，它不會自動換行，我看到很多人的blog裡面貼的代碼都是需要把滾動條拉到最右端才能看到全部代碼。其實你只要定義下pre的css就可以了(我說的是廢話)。 具體定義如下 1 2 3 pre &#123; white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ &#125; &#160; * html pre &#123; word-wrap: break-word; /* &#8230; <a href="http://leeiio.me/pre-wrap/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://imgs.guaniu.com/blogpics/month_0812/20081204_css-pre.gif" alt="讓你的pre標記自動換行" title="讓你的pre標記自動換行" /></p>
<p class="fl">最近發了很多都要貼代碼的文，我貼代碼用的插件是<a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/">Wp-Codebox</a>，另外我也比對過其他的一些插件諸如<a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/">WP-Syntax</a>和<a href="http://wordpress.org/extend/plugins/syntaxhighlighter/">SyntaxHighlighter</a>。這些插件被解析出來後無非就是&lt;pre&gt;&lt;/pre&gt;。但是有個問題就是有時候貼的代碼過長，它不會自動換行，我看到很多人的blog裡面貼的代碼都是需要把滾動條拉到最右端才能看到全部代碼。其實你只要定義下pre的css就可以了(我說的是廢話)。</p>
<p><span id="more-572"></span><br />
具體定義如下</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">pre <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">white-space</span><span style="color: #00AA00;">:</span> pre-wrap<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* css-3 */</span> <span style="color: #000000; font-weight: bold;">white-space</span><span style="color: #00AA00;">:</span> -moz-pre-wrap<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Mozilla, since 1999 */</span> <span style="color: #000000; font-weight: bold;">white-space</span><span style="color: #00AA00;">:</span> -pre-wrap<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Opera 4-6 */</span> <span style="color: #000000; font-weight: bold;">white-space</span><span style="color: #00AA00;">:</span> -o-pre-wrap<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Opera 7 */</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #00AA00;">*</span> html pre <span style="color: #00AA00;">&#123;</span> word-wrap<span style="color: #00AA00;">:</span> break-word<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Internet Explorer 5.5+ */</span> <span style="color: #000000; font-weight: bold;">white-space</span> <span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span> <span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Internet Explorer 5.5+ */</span> <span style="color: #00AA00;">&#125;</span>   //如果你是用插件貼代碼的，不要加上這個，否則在IE在會出錯，不信你試試</pre></td></tr></table></div>

<p>具體你可以看我<a href="http://leeiio.me/php-browser-lang/">這個頁面</a>。大功告成。就是如此。<br />
對此CSS定義更詳細的說明請戳<a href="http://users.tkk.fi/~tkarvine/pre-wrap-css3-mozilla-opera-ie.html" class="broken_link">這裡</a>。</p>
]]></content:encoded>
			<wfw:commentRss>http://leeiio.me/pre-wrap/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
	</channel>
</rss>

