<?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>行骏-IT Player &#187; 未分类</title>
	<atom:link href="http://www.movinghorse.cn/category/%e6%9c%aa%e5%88%86%e7%b1%bb/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.movinghorse.cn</link>
	<description>Front End Engineer</description>
	<lastBuildDate>Fri, 09 Jul 2010 13:25:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>创业网站</title>
		<link>http://www.movinghorse.cn/2009/11/24/new-website/</link>
		<comments>http://www.movinghorse.cn/2009/11/24/new-website/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 16:15:58 +0000</pubDate>
		<dc:creator>行骏</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://www.movinghorse.cn/?p=112</guid>
		<description><![CDATA[这就是一个创业网站一个主导航下的一个页面，回想起现在要是公司出现了这样的页面，那我今晚肯定没有时间煮泡面了！而且会大动干戈！ 又想现在网站如此复杂的产品和不那么高效的流程，真是捏喊、、、 这就是创业网站，不怕出错，但行动迅速，目空一切&#8230; © 行骏 for 行骏-IT Player, 2009. &#124; Permalink &#124; One comment &#124; Add to del.icio.us Post tags: Feed enhanced by Better Feed from Ozh]]></description>
			<content:encoded><![CDATA[<div id="attachment_113" class="wp-caption alignnone" style="width: 310px"><img class="size-medium wp-image-113" title="翻东西" src="http://www.movinghorse.cn/wp-content/uploads/fandongxi-300x181.jpg" alt="翻东西" width="300" height="181" /><p class="wp-caption-text">翻东西</p></div>
<p>这就是一个创业网站一个主导航下的一个页面，回想起现在要是公司出现了这样的页面，那我今晚肯定没有时间煮泡面了！而且会大动干戈！</p>
<p>又想现在网站如此复杂的产品和不那么高效的流程，真是捏喊、、、</p>
<p>这就是创业网站，不怕出错，但行动迅速，目空一切&#8230;</p>
<hr />
<p><small>© 行骏 for <a href="http://www.movinghorse.cn">行骏-IT Player</a>, 2009. |
<a href="http://www.movinghorse.cn/2009/11/24/new-website/">Permalink</a> |
<a href="http://www.movinghorse.cn/2009/11/24/new-website/#comments">One comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.movinghorse.cn/2009/11/24/new-website/&title=创业网站">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.movinghorse.cn/2009/11/24/new-website/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>发一个交互细节，因为没看到过</title>
		<link>http://www.movinghorse.cn/2009/10/31/a-detail/</link>
		<comments>http://www.movinghorse.cn/2009/10/31/a-detail/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 02:47:57 +0000</pubDate>
		<dc:creator>行骏</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://www.movinghorse.cn/?p=102</guid>
		<description><![CDATA[没有保存的关闭需要确认吗？哦，是的，的确是需要确认的。但是这个确认框为什么总是在屏幕的最中间弹出呢，我的鼠标在叉叉那儿，要是这个不可缺少的确认框能在叉叉的边上那就爽多了，，，其实我们很不想鼠标移来移去。 到现在为止，我没看过有这样的设计！欢迎尝试！！ © 行骏 for 行骏-IT Player, 2009. &#124; Permalink &#124; 4 comments &#124; Add to del.icio.us Post tags: Feed enhanced by Better Feed from Ozh]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-107" title="InteractionDesign2" src="http://www.movinghorse.cn/wp-content/uploads/InteractionDesign2.jpg" alt="InteractionDesign2" width="600" height="458" /></p>
<p>没有保存的关闭需要确认吗？哦，是的，的确是需要确认的。但是这个确认框为什么总是在屏幕的最中间弹出呢，我的鼠标在叉叉那儿，要是这个不可缺少的确认框能在叉叉的边上那就爽多了，，，其实我们很不想鼠标移来移去。</p>
<p><strong>到现在为止，我没看过有这样的设计！欢迎尝试！！</strong></p>
<hr />
<p><small>© 行骏 for <a href="http://www.movinghorse.cn">行骏-IT Player</a>, 2009. |
<a href="http://www.movinghorse.cn/2009/10/31/a-detail/">Permalink</a> |
<a href="http://www.movinghorse.cn/2009/10/31/a-detail/#comments">4 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.movinghorse.cn/2009/10/31/a-detail/&title=发一个交互细节，因为没看到过">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.movinghorse.cn/2009/10/31/a-detail/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>博客搬家完成，换了主机，换到了WP，一切从头开始！</title>
		<link>http://www.movinghorse.cn/2009/10/24/begin-bloger-2/</link>
		<comments>http://www.movinghorse.cn/2009/10/24/begin-bloger-2/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 08:59:01 +0000</pubDate>
		<dc:creator>行骏</dc:creator>
				<category><![CDATA[未分类]]></category>
		<category><![CDATA[PJBlog WP 转换]]></category>

		<guid isPermaLink="false">http://www.movinghorse.cn/?p=91</guid>
		<description><![CDATA[用了两年的Win主机和PJBlog终于退场了，主机是用钱买的，没必要感谢。PJBlog是免费用的，感谢下腾讯的PuterJam同学，此asp博客已经灰常不错了！ 既然都换了，但是数据还是要啊，所以得把原来在PJBlog中的数据导入到WP中，这里介绍我使用的一种简单方法。 WP支持多种格式的导入，常见的有SQL等，我用的RSS标准的XML文件，这个及其方便。 使用RSS2.0 XML文件从PJBlog博客导入数据岛WP平台 1. 首先要修改feed.asp文件，找到SQL = &#8220;SELECT TOP 10 L.log_ID,L.log_Title,l.log_Author,L.log省略，这里TOP 10是你要修改的数值，要全部导出就删掉TOP 10好了，数字多少自己斟酌，因为WP默认只能导入2M以内的文件。 2. 然后在你浏览器里访问http://你的域名/feed.asp，然后保存源文件。 3. 我以为现在直接导入就OK了，在这里我告诉你，不行的。两者的定义是不一样的。主要有一个，WP的内容定义是&#60;content:encoded&#62;&#60;/content:encoded&#62;,然后你在编辑器里批量替换就行了。WP的定义很多，我没有一一核对，当然你要向知道，可去读文档（我不知道文档在哪儿），你也可以随便发片文章，然后在WP导出，看看他导出是什么样子的，对比下就清楚了！我就是这么搞的！ 我没有把以前所有的文章都导进来，因为我之前很多的文章都是转的，现在我要开始原创。伟人说：当你不会的时候你要先学会模仿，当你会了，你要学会创造。 PS：最早之前的订阅的地址有变化，麻烦又订阅的重新订阅！ © 行骏 for 行骏-IT Player, 2009. &#124; Permalink &#124; 3 comments &#124; Add to del.icio.us Post tags: PJBlog WP 转换 Feed enhanced by Better Feed from Ozh]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-97" title="创造" src="http://www.movinghorse.cn/wp-content/uploads/20070424143801851240.jpg" alt="创造" width="500" height="685" /><br />
用了两年的Win主机和PJBlog终于退场了，主机是用钱买的，没必要感谢。PJBlog是免费用的，感谢下腾讯的<a title="PuterJam" href="http://www.pjhome.net/" target="_blank">PuterJam</a>同学，此asp博客已经灰常不错了！</p>
<p>既然都换了，但是数据还是要啊，所以得把原来在PJBlog中的数据导入到WP中，这里介绍我使用的一种简单方法。</p>
<p>WP支持多种格式的导入，常见的有SQL等，我用的RSS标准的XML文件，这个及其方便。</p>
<p><strong>使用RSS2.0 XML文件从PJBlog博客导入数据岛WP平台</strong></p>
<p>1. 首先要修改feed.asp文件，找到SQL = &#8220;SELECT TOP 10 L.log_ID,L.log_Title,l.log_Author,L.log省略，这里TOP 10是你要修改的数值，要全部导出就删掉TOP 10好了，数字多少自己斟酌，因为WP默认只能导入2M以内的文件。</p>
<p>2. 然后在你浏览器里访问http://你的域名/feed.asp，然后保存源文件。</p>
<p>3. 我以为现在直接导入就OK了，在这里我告诉你，不行的。两者的定义是不一样的。主要有一个，WP的内容定义是&lt;content:encoded&gt;&lt;/content:encoded&gt;,然后你在编辑器里批量替换就行了。WP的定义很多，我没有一一核对，当然你要向知道，可去读文档（我不知道文档在哪儿），你也可以随便发片文章，然后在WP导出，看看他导出是什么样子的，对比下就清楚了！我就是这么搞的！</p>
<p><strong>我没有把以前所有的文章都导进来，因为我之前很多的文章都是转的，现在我要开始原创。伟人说：当你不会的时候你要先学会模仿，当你会了，你要学会创造。</strong></p>
<p><strong>PS：最早之前的订阅的地址有变化，麻烦又订阅的重新订阅！<br />
</strong></p>
<hr />
<p><small>© 行骏 for <a href="http://www.movinghorse.cn">行骏-IT Player</a>, 2009. |
<a href="http://www.movinghorse.cn/2009/10/24/begin-bloger-2/">Permalink</a> |
<a href="http://www.movinghorse.cn/2009/10/24/begin-bloger-2/#comments">3 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.movinghorse.cn/2009/10/24/begin-bloger-2/&title=博客搬家完成，换了主机，换到了WP，一切从头开始！">del.icio.us</a>
<br/>
Post tags: <a href="http://www.movinghorse.cn/tag/pjblog-wp-%e8%bd%ac%e6%8d%a2/" rel="tag">PJBlog WP 转换</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.movinghorse.cn/2009/10/24/begin-bloger-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mag &amp; Die &#8211; Going Away</title>
		<link>http://www.movinghorse.cn/2009/09/05/mag-die-going-away/</link>
		<comments>http://www.movinghorse.cn/2009/09/05/mag-die-going-away/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 04:07:38 +0000</pubDate>
		<dc:creator>行骏</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://movinghorse.cn/default.asp?id=265</guid>
		<description><![CDATA[歌曲名: Going Away 歌手: Mag &#38; Die 音乐风格: 摇滚 专辑:Here, Here And Here 发行时间: 2009年06月 韩裔美籍姐妹所组成的摇滚 双人组Meg &#38; Dia，妹妹Dia是乐队的主唱，而姐姐Meg则是乐队的吉他手，她们已经参加过很多大大小小的巡回演出，受到歌迷们的好评，并且积累了很多丰富的经验， 这为她们未来的音乐创作奠定了基础。她们的首张专辑Something Real于2006年发行，这张是她们2009年的第二张大碟，整张专辑都是抒情缓慢的摇滚歌曲，音乐中充满了年轻人那种活力和积极向上的感觉，轻松、活 泼的旋律总能抓住你的耳朵 going away meg&#38;dia Please don&#8217;t forget me, I&#8217;m going away. I&#8217;m taking a taxi to Kentucky, Where they don&#8217;t even know All about me; I just need to feel safe. I&#8217;ve got a [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://movinghorse.cn/attachments/month_0909/d20099512024.jpg" alt="" /></p>
<div id="iptcomCname"><span><strong>歌曲名</strong>: </span>Going Away</div>
<div id="iptcomActor"><span><strong>歌手</strong>: Mag &amp; Die</span></div>
<div id="iptcomKind"><span><strong>音乐风格</strong>: 摇滚</span></div>
<div id="iptcomFiletype"><span><strong>专辑</strong>:Here, Here And Here </span><span><strong><br />
</strong></span></div>
<div id="iptcomTime"><span><strong>发行时间</strong>: </span>2009年06月</div>
<div>韩裔美籍姐妹所组成的摇滚 双人组Meg &amp; Dia，妹妹Dia是乐队的主唱，而姐姐Meg则是乐队的吉他手，她们已经参加过很多大大小小的巡回演出，受到歌迷们的好评，并且积累了很多丰富的经验， 这为她们未来的音乐创作奠定了基础。她们的首张专辑Something Real于2006年发行，这张是她们2009年的第二张大碟，整张专辑都是抒情缓慢的摇滚歌曲，音乐中充满了年轻人那种活力和积极向上的感觉，轻松、活 泼的旋律总能抓住你的耳朵</div>
<p>going away<br />
meg&amp;dia<br />
Please don&#8217;t forget me, I&#8217;m going away.<br />
I&#8217;m taking a taxi to Kentucky,<br />
Where they don&#8217;t even know<br />
All about me; I just need to feel safe.<br />
I&#8217;ve got a thousand sweaters, and shoes,<br />
And paintings to hide;<br />
The skeletons in my way, don&#8217;t ask where I&#8217;m going<br />
I&#8217;m going away, I&#8217;m going my way.<br />
Finally, it&#8217;s my time, to be lonely enough. unloved and I can&#8217;t wait.<br />
Dont forget what I said, don&#8217;t forget my letter.<br />
Every night I pray for you.<br />
I don&#8217;t got a religion. Isnt that something? I miss those days.<br />
I see that bottle, it&#8217;s now ten years aged.<br />
I&#8217;ve got the marbles I could sell for money, got a pair of fresh shaved legs.<br />
Won&#8217;t you baby come with me?<br />
I&#8217;ve got a extra space<br />
In my car, in my heart, in my mind<br />
Look there&#8217;s the passenger seat by the boat that you gave<br />
Don&#8217;t know where I&#8217;m going&#8230;<br />
I&#8217;m going away, I&#8217;m going my way.<br />
finally it&#8217;s my time, to be lonely enough. unloved and I can&#8217;t wait.<br />
Don&#8217;t forget what I said; don&#8217;t forget my letter.<br />
Every night I pray for you,<br />
I don&#8217;t got a religion. Isnt that something? I miss those days.<br />
Well he said, slow down; slow down;<br />
Think it over, weve all got wretched closets.<br />
A silly girl pride kills more than AIDS<br />
Lately I say come on, I&#8217;ve thought it over,<br />
I don&#8217;t wanna die here; I&#8217;ve no desire to get married.<br />
I can&#8217;t read the others anymore.<br />
Alone, I must learn to race myself<br />
I&#8217;m going away, I&#8217;m going my way<br />
Finally it&#8217;s my time, to be lonely enough. Unloved and I can&#8217;t wait<br />
please forget what I said, please forget my letter.<br />
Every night I pray for you;<br />
I don&#8217;t got a religion to think that something will make those days.<br />
I, I&#8217;m not going halfway (I&#8217;ll find my way)<br />
I, I, Every night I pray for you,<br />
Don&#8217;t believe in Heaven or that it could be a happy place<br />
I,<br />
I&#8217;m going away</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="160" height="32" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.8box.com/feed/000000_s_565756_/mini.swf" /><param name="wmode" value="transparent" /><embed type="application/x-shockwave-flash" width="160" height="32" src="http://www.8box.com/feed/000000_s_565756_/mini.swf" wmode="transparent"></embed></object></p>
<p>下载地址：http://www.rayfile.com/files/396a1075-99d2-11de-b7dd-0014221b798a/</p>
<hr />
<p><small>© 行骏 for <a href="http://www.movinghorse.cn">行骏-IT Player</a>, 2009. |
<a href="http://www.movinghorse.cn/2009/09/05/mag-die-going-away/">Permalink</a> |
<a href="http://www.movinghorse.cn/2009/09/05/mag-die-going-away/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.movinghorse.cn/2009/09/05/mag-die-going-away/&title=Mag &#038; Die &#8211; Going Away">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.movinghorse.cn/2009/09/05/mag-die-going-away/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>征服高级CSS选择器</title>
		<link>http://www.movinghorse.cn/2009/09/01/study-adcenced-css-selector/</link>
		<comments>http://www.movinghorse.cn/2009/09/01/study-adcenced-css-selector/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 15:58:13 +0000</pubDate>
		<dc:creator>行骏</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://movinghorse.cn/default.asp?id=264</guid>
		<description><![CDATA[原文：征服高级CSS选择器 译自：Taming Advanced CSS Selectors CSS是对网页设计师可用的最强大的工具之一。使用它我们可以在几分钟内改变一个网站的界面，而不用改变页面的标签。但是尽管事实上，我们每个人也都意识到了它是有用的，CSS 选择器远未发挥它们的潜力，有的时候我们还趋向于使用过多的和无用的class、id、div、span等把我们的HTML搞的很凌乱。 &#160; 避免让这些&#8220;瘟疫&#8221;在你的标签中传播并保持其简洁和语义化的最佳方式，就是使用更复杂的CSS选择器，它们可以定位于指定的元素而不用使用额外的class或id，而且通过这种方式也可以让我们的代码和样式更加灵活。 CSS的优先级 在深入研究高级CSS选择器领域之前，理解CSS优先级是如何工作的是很重要的，这样我们就知道如何适当的使用我们的选择器并避免浪费大量的时间来调试一些只要我们注意到优先级的话就很容易被搞定的问题 当我们写CSS的时候我们必须注意有些选择器在级联(cascade)上会高于其它选择器，我们写在最后面的选择器将不一定会覆盖前面我们写在同一个元素的样式。 那么你如何计算指定选择器的优先级？如果你考虑到将优先级表示为用逗号隔开的四个数字就会相当简单，比如：1, 1, 1, 1 或0, 2, 0, 1 第一个数字(a)通常就是0，除非在标签上使用style属性； 第二个数字(b)是该选择器上的id的数量的总和； 第三个数字(c)是用在该选择器上的其它属性选择器和伪类的总和。这里包括class (.example) 和属性选择器(比如 li[id=red])； 第四个数字(d)计算元素(就像table、p、div等等)和伪元素(就像:first-line等)； 通用选择器(*)是0优先级； 如果两个选择器有同样的优先级，在样式表中后面的那个起作用。 让我们看几个例子，这样或许比较容易理解些： #sidebar h2 &#8212; 0, 1, 0, 1 h2.title &#8212; 0, 0, 1, 1 h2 + p &#8212; 0, 0, 0, 2 #sidebar p:first-line &#8212; 0, [...]]]></description>
			<content:encoded><![CDATA[<div>原文：<a href="http://www.qianduan.net/taming-advanced-css-selectors.html" target="_blank" closure_hashcode_z9wadg="1811">征服高级CSS选择器</a><br />
译自：<a href="http://www.smashingmagazine.com/2009/08/17/taming-advanced-css-selectors/" target="_blank" closure_hashcode_z9wadg="1812">Taming Advanced CSS Selectors</a></p>
<hr />
</div>
<p>CSS是对网页设计师可用的最强大的工具之一。使用它我们可以在几分钟内改变一个网站的界面，而不用改变页面的标签。但是尽管事实上，我们每个人也都意识到了它是有用的，CSS 选择器远未发挥它们的潜力，有的时候我们还趋向于使用过多的和无用的class、id、div、span等把我们的HTML搞的很凌乱。</p>
<p>&nbsp;</p>
<p>避免让这些&ldquo;瘟疫&rdquo;在你的标签中传播并保持其简洁和语义化的最佳方式，就是使用更复杂的CSS选择器，它们可以定位于指定的元素而不用使用额外的class或id，而且通过这种方式也可以<strong>让我们的代码和样式更加灵活</strong>。</p>
<h3>CSS的优先级</h3>
<p>在深入研究高级CSS选择器领域之前，理解CSS优先级是如何工作的是很重要的，这样我们就知道如何适当的使用我们的选择器并避免浪费大量的时间来调试一些只要我们注意到优先级的话就很容易被搞定的问题</p>
<p>当我们写CSS的时候我们必须注意有些选择器在级联(cascade)上会<strong>高于</strong>其它选择器，我们写在最后面的选择器将不一定会覆盖前面我们写在同一个元素的样式。</p>
<p>那么你如何<strong>计算指定选择器的优先级</strong>？如果你考虑到将优先级表示为用逗号隔开的四个数字就会相当简单，比如：1, 1, 1, 1 或0, 2, 0, 1</p>
<ol>
<li>第一个数字(a)通常就是0，除非在标签上使用style属性；</li>
<li>第二个数字(b)是该选择器上的id的数量的总和；</li>
<li>第三个数字(c)是用在该选择器上的其它属性选择器和伪类的总和。这里包括class (.example) 和属性选择器(比如 li[id=red])；</li>
<li>第四个数字(d)计算元素(就像table、p、div等等)和伪元素(就像:first-line等)；</li>
<li>通用选择器(*)是0优先级；</li>
<li>如果两个选择器有同样的优先级，在样式表中后面的那个起作用。</li>
</ol>
<p>让我们看几个例子，这样或许比较容易理解些：</p>
<ul>
<li>#sidebar h2 &mdash; 0, 1, 0, 1</li>
<li>h2.title &mdash; 0, 0, 1, 1</li>
<li>h2 + p &mdash; 0, 0, 0, 2</li>
<li>#sidebar p:first-line &mdash; 0, 1, 0, 2</li>
</ul>
<p>在下面的例子中，第一个将会起作用，因为它比第二个优先级高：</p>
<ul>
<li>#sidebar p#first { color: red; } &mdash; 0, 2, 0, 1</li>
<li>#sidebar p:first-line { color: blue; } &mdash; 0, 1, 0, 2</li>
</ul>
<p>至少基本理解优先级是如何工作的是很重要的，但是一些工具比如<strong>Firebug</strong>，在我们审查指定元素的时候，按照选择器的优先级列出所有的css选择器对让我们知道在指定元素上哪个选择器是有效的是很有用的。</p>
<p><img height="256" src="http://www.qianduan.net/wp-content/uploads/2009/08/firebug.jpg" width="535" alt="" /><br />
<em>让你非常容易的看到那个选择器作用于一个元素上了。</em></p>
<p>有用的文章:</p>
<ul>
<li><a href="http://www.smashingmagazine.com/2007/07/27/css-specificity-things-you-should-know/" target="_blank" closure_hashcode_z9wadg="1813">CSS Specificity: Things You Should Know</a></li>
<li><a href="http://meyerweb.com/eric/css/link-specificity.html" target="_blank" closure_hashcode_z9wadg="1814">Link Specificity&macr;MeyerWeb</a></li>
<li><a href="http://www.stuffandnonsense.co.uk/archives/css_specificity_wars.html" target="_blank" closure_hashcode_z9wadg="1815">CSS: Specificity Wars</a></li>
<li><a href="http://www.w3.org/TR/CSS2/cascade.html" target="_blank" closure_hashcode_z9wadg="1816">Assigning property values, Cascading, and Inheritance&mdash;W3C</a></li>
</ul>
<h3>1. 属性选择器</h3>
<p>属性选择器(Attribute selector)让你可以基于属性来定位一个元素。你可以只指定该元素的某个属性，这样所有使用该属性&mdash;&mdash;而不管它的值&mdash;&mdash;的这个元素都将被定位，也可以更加明确并<strong>定位在这些属性上使用特定值的元素</strong> &mdash;&mdash; 这就是属性选择器展示它们的威力的地方。</p>
<p>有6个不同类型的属性选择器：</p>
<ul>
<li>[att=value]<br />
    该属性有指定的确切的值。</li>
<li>[att~=value]<br />
    该属性的值必须是一系列用空格隔开的多个值，(比如，class=&rdquo;title featured home&rdquo;)，而且这些值中的一个必须是指定的值&rdquo;value&rdquo;。</li>
<li>[att|=value]<br />
    属性的值就是&ldquo;value&rdquo;或者以&ldquo;value&rdquo;开始并立即跟上一个&ldquo;-&rdquo;字符，也就是&ldquo;value-&rdquo;。(比如lang=&rdquo;zh-cn&rdquo;)</li>
<li>[att^=value]<br />
    该属性的值以指定值开始。</li>
<li>[att$=value]<br />
    该属性的值包含指定的值(而无论其位置)。</li>
<li>[att*=value]<br />
    该属性的值以指定的值结束</li>
</ul>
<p>比如，如果你想要<strong>改变你的博客上的日志部分元素的背景颜色</strong>，你可以使用一个指定每一个class属性值以&ldquo;post-&rdquo;开始的div的属性选择器：</p>
<div>
<div>
<pre style="font-family: monospace">
div<span style="color: #00aa00">[</span>class|<span style="color: #00aa00">=</span><span style="color: #ff0000">&quot;post&quot;</span><span style="color: #00aa00">]</span> <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">background-color</span><span style="color: #00aa00">:</span> <span style="color: #cc00cc">#333</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>该语句将匹配所有class属性包含&rdquo;post&rdquo;并带&rdquo;-&rdquo;字符的div元素。(注：此处英文原文有些上下文不对应，我已经更正&mdash;&mdash;译者，神飞)</p>
<p>属性选择器的另一个很有用的用处是<strong>定位不同类型的input元素</strong>。比如，如果你想让你的文本输入框使用一个特定的宽度，你可以使用下面的属性选择器：</p>
<div>
<div>
<pre style="font-family: monospace">
input<span style="color: #00aa00">[</span>type<span style="color: #00aa00">=</span><span style="color: #ff0000">&quot;text&quot;</span><span style="color: #00aa00">]</span> <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">width</span><span style="color: #00aa00">:</span> <span style="color: #933">200px</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>这将匹配所有type属性值等于&ldquo;text&rdquo;的input元素。</p>
<p>现在我们可能像为网站上<strong>不同的文件类型的链接添加不同的图标</strong>，这样你的网站的访客就会知道他们将获得一个图片、或者PDF文件、或者是一个word文档等。这就可以使用属性选择器来实现：</p>
<div>
<div>
<pre style="font-family: monospace">
a<span style="color: #00aa00">[</span>href<span style="color: #00aa00">*=</span><span style="color: #ff0000">&quot;.jpg&quot;</span><span style="color: #00aa00">]</span> <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">background</span><span style="color: #00aa00">:</span> <span style="color: #993333">url</span><span style="color: #00aa00">(</span><span style="color: #ff0000; font-style: italic">jpeg.gif</span><span style="color: #00aa00">)</span> <span style="color: #993333">no-repeat</span> <span style="font-weight: bold; color: #000000">left</span> <span style="color: #933"><span style="color: #cc66cc">50</span>%</span><span style="color: #00aa00">;</span>
	<span style="font-weight: bold; color: #000000">padding</span><span style="color: #00aa00">:</span> <span style="color: #933">2px</span> <span style="color: #cc66cc">0</span> <span style="color: #933">2px</span> <span style="color: #933">20px</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span>
&nbsp;
a<span style="color: #00aa00">[</span>href<span style="color: #00aa00">*=</span><span style="color: #ff0000">&quot;.pdf&quot;</span><span style="color: #00aa00">]</span> <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">background</span><span style="color: #00aa00">:</span> <span style="color: #993333">url</span><span style="color: #00aa00">(</span><span style="color: #ff0000; font-style: italic">pdf.gif</span><span style="color: #00aa00">)</span> <span style="color: #993333">no-repeat</span> <span style="font-weight: bold; color: #000000">left</span> <span style="color: #933"><span style="color: #cc66cc">50</span>%</span><span style="color: #00aa00">;</span>
	<span style="font-weight: bold; color: #000000">padding</span><span style="color: #00aa00">:</span> <span style="color: #933">2px</span> <span style="color: #cc66cc">0</span> <span style="color: #933">2px</span> <span style="color: #933">20px</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span>
&nbsp;
a<span style="color: #00aa00">[</span>href<span style="color: #00aa00">*=</span><span style="color: #ff0000">&quot;.doc&quot;</span><span style="color: #00aa00">]</span> <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">background</span><span style="color: #00aa00">:</span> <span style="color: #993333">url</span><span style="color: #00aa00">(</span><span style="color: #ff0000; font-style: italic">word.gif</span><span style="color: #00aa00">)</span> <span style="color: #993333">no-repeat</span> <span style="font-weight: bold; color: #000000">left</span> <span style="color: #933"><span style="color: #cc66cc">50</span>%</span><span style="color: #00aa00">;</span>
	<span style="font-weight: bold; color: #000000">padding</span><span style="color: #00aa00">:</span> <span style="color: #933">2px</span> <span style="color: #cc66cc">0</span> <span style="color: #933">2px</span> <span style="color: #933">20px</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>在此例中，我们使用了一个定位所有的链接(a)的href属性分别以.jpg,.pdf或.doc结束(*)的属性选择器。详细可查看前端观察之前的一篇文章《<a href="http://www.qianduan.net/css-selectors-customization-link-style.html" target="_blank" closure_hashcode_z9wadg="1817">使用CSS选择器创建个性化链接样式</a>》</p>
<h4>浏览器支持</h4>
<p>除了Internet Explorer 6，所有的主流浏览器都支持属性选择器。这意味着，如果你在你的网站上使用了属性选择器，你应该<strong>确保IE6用户将仍能获得一个可用的网站</strong>。比如我们的第三个例子，为链接添加图标可以给你的网站带来另一个级别的可用性，但是如果这些链接不显示任何图标，该网站仍然还是可用的。</p>
<h3>2. 子选择器</h3>
<p>子选择器用符号&ldquo;&gt;&rdquo;表示。它允许你<strong>定位某个元素的第一级子元素</strong>。</p>
<p>比如，如果你想匹配所有的作为你的网站侧栏的div的子元素的h2元素，而不是可能是在div元素内的所有h2元素，也不是div的孙元素(或者更低级别的)，你就可以使用下面的选择器：</p>
<div>
<div>
<pre style="font-family: monospace">
div<span style="color: #cc00cc">#sidebar</span> &amp;gt<span style="color: #00aa00">;</span> h2 <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">font-size</span><span style="color: #00aa00">:</span> <span style="color: #933">20px</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>你当然也可以同时使用子元素和后代元素。比如，如果你想定位只有在body元素的子级div元素内的blockquote元素(比如你想匹配主要的div内的blockquotes，而不是其它部分的：</p>
<div>
<div>
<pre style="font-family: monospace">
body &amp;gt<span style="color: #00aa00">;</span> div &amp;gt<span style="color: #00aa00">;</span> div blockquote <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">margin-left</span><span style="color: #00aa00">:</span> <span style="color: #933">30px</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<h4>浏览器支持</h4>
<p>和属性选择器一样，子选择器不被IE6支持。如果你通过这种方式要实现的效果和网站的可用性或总体设计息息相关，你可以考虑使用一个class，或者使用只针对IE6的样式，但是这将有悖使用子选择器的目的。</p>
<h3>3. 兄弟组合</h3>
<p>有两类兄弟组合：临近兄弟组合和普通兄弟组合</p>
<h4>临近兄弟组合</h4>
<p>该选择器使用加号&ldquo;+&rdquo;来链接前后两个选择器。选择器中的元素有<strong>同一个父亲</strong>，而且<strong>第二个必须紧紧的跟着第一个</strong>。</p>
<p>临近兄弟组合可以灰常有用，比如，在<strong>处理文字的时候</strong>。比如我们想对段落后面的h2标题添加一个顶间距&ldquo;margin-top&rdquo;(当然或许你无需为h1标签后面的h2添加，或者它可能是页面的第一个元素)：</p>
<div>
<div>
<pre style="font-family: monospace">
p <span style="color: #00aa00">+</span> h2 <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">margin-top</span><span style="color: #00aa00">:</span> <span style="color: #933">10px</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>你甚至可以更加具体，你想定位某个特定的div后面的h2：</p>
<div>
<div>
<pre style="font-family: monospace">
div<span style="color: #6666ff">.post</span> p <span style="color: #00aa00">+</span> h2 <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">margin-top</span><span style="color: #00aa00">:</span> <span style="color: #933">10px</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>或者你可以搞得更加复杂：页面的第一个段落的第一行字母显示为小写字母。</p>
<div>
<div>
<pre style="font-family: monospace"><span style="color: #6666ff">.post</span> h1 <span style="color: #00aa00">+</span> p<span style="color: #3333ff">:first-line </span><span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">font-variant</span><span style="color: #00aa00">:</span> <span style="color: #993333">small-caps</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>因为可能大部分日志/文章的第一个段落都会紧紧的在H1标签的后面。你可以在你的选择器中借助于h1标签。</p>
<h4>普通兄弟组合</h4>
<p>普通兄弟组合和临近兄弟组合的工作原理很像，不同的是<strong>第二个选择其无需紧紧跟随第一个</strong>。</p>
<p>如果你需要定位所有的某个特定的div里面并且跟在h1标签后面的p标签的话(你可能想要这些p标签比拟的日志的标题前面的文字大些)，你就可以使用这个选择器：</p>
<div>
<div>
<pre style="font-family: monospace"><span style="color: #6666ff">.post</span> h1 ~ p <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">font-size</span><span style="color: #00aa00">:</span> <span style="color: #933">13px</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>注：这两个选择器太像了，所有不是很好理解，可以试一试下面的这个例子：</p>
<p><strong>CSS:</strong></p>
<div>
<div>
<pre style="font-family: monospace">
p <span style="color: #00aa00">+</span> h2<span style="color: #00aa00">{</span><span style="font-weight: bold; color: #000000">color</span><span style="color: #00aa00">:</span><span style="color: #993333">red</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span>
	p ~ h2<span style="color: #00aa00">{</span><span style="font-weight: bold; color: #000000">font-weight</span><span style="color: #00aa00">:</span><span style="color: #cc66cc">700</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p><strong>HTML:</strong></p>
<div>
<div>
<pre style="font-family: monospace"><span style="color: #009900">&lt;<span style="font-weight: bold; color: #000000">p</span>&gt;</span>咳咳，内容。<span style="color: #009900">&lt;<span style="color: #66cc66">/</span><span style="font-weight: bold; color: #000000">p</span>&gt;</span>
<span style="color: #009900">&lt;<span style="font-weight: bold; color: #000000">h2</span>&gt;</span>标题1<span style="color: #009900">&lt;<span style="color: #66cc66">/</span><span style="font-weight: bold; color: #000000">h2</span>&gt;</span>
<span style="color: #009900">&lt;<span style="font-weight: bold; color: #000000">h2</span>&gt;</span>标题2<span style="color: #009900">&lt;<span style="color: #66cc66">/</span><span style="font-weight: bold; color: #000000">h2</span>&gt;</span></pre>
</div>
</div>
<p>看看第二个h2的颜色就可以理解了吧？临近兄弟组合只能匹配第一个选择器后面的第一个兄弟选择其，普通兄弟组合则能匹配所有。注：该部分英文原文没有，是神飞翻译时自己添加。</p>
<h4>浏览器支持</h4>
<p>Internet Explorer 6依然不能理解兄弟选择器，但是，另一种情况，如果你的用户中只有一小部分是IE6用户，而且网站的结构不会被破坏或者受到严重影响，这是实现很多很酷的效果而无需在你的HTML代码中添加无用的class或id。</p>
<h3>4. 伪类</h3>
<h4>动态伪类</h4>
<p>之所以被称为动态伪类是因为它们并不存在于HTML中&mdash;&mdash;而是只有<strong>当用户和网站交互的时候</strong>才会呈现。</p>
<p>有两类动态伪类：<strong>链接</strong> 和<strong>用户行为</strong>。链接就是:link 和:visited，而用户行为包括:hover、:active 和:focus。</p>
<p>在本文中提到的css选择器中，这几个应该是<strong>最常用到</strong>的。</p>
<p><strong>:link</strong>伪类用于链接尚未被用户访问的时候，而<strong>:visited</strong> 伪类用于用户访问过的链接，也就是说它们是相反的。</p>
<p><strong>:hover</strong>伪类用于用户移动他们的鼠标在元素上，而尚未触发或点击它的时候。<strong>:active</strong>伪类应用于用户点击元素的情况。最后，<strong>:focus</strong>伪类用于元素成为焦点的时候&mdash;&mdash;最常用于表单元素。</p>
<p>你可以在你的样式表中使用多种用户行为动态伪类，这样你就可以，比如，根据用户的鼠标只是滑过或悬停的时候，为一个输入框定义不同的背景色:</p>
<div>
<div>
<pre style="font-family: monospace">
input<span style="color: #3333ff">:focus </span><span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">background</span><span style="color: #00aa00">:</span> <span style="color: #cc00cc">#D2D2D2</span><span style="color: #00aa00">;</span>
	<span style="font-weight: bold; color: #000000">border</span><span style="color: #00aa00">:</span> <span style="color: #933">1px</span> <span style="color: #993333">solid</span> <span style="color: #cc00cc">#5E5E5E</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span>
input<span style="color: #3333ff">:focus</span><span style="color: #3333ff">:hover </span><span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">background</span><span style="color: #00aa00">:</span> <span style="color: #cc00cc">#C7C7C7</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<h5>浏览器兼容性</h5>
<p>动态伪类被所有的现代浏览器支持，甚至IE6，但是请注意，对于IE系列浏览器来说，IE6只允许:hover 伪类应用于链接元素(a标签)而且只有IE8接受:active状态。</p>
<h4>:first-child</h4>
<p>:first-child伪类允许你定位某个元素<strong>第一个子元素</strong>。比如，如果你想给你的无须列表的第一个li添加一个margin-top，你就可以这样写：</p>
<div>
<div>
<pre style="font-family: monospace">
ul &amp;gt<span style="color: #00aa00">;</span> li<span style="color: #3333ff">:first-child </span><span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">margin-top</span><span style="color: #00aa00">:</span> <span style="color: #933">10px</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>让我们来看一看另一个例子:比如你想让你的博客的侧栏的H2标签都有个顶部边距，以将标题和它们前面的内容区分开来，但是第一个h2不需要，你就可以使用下面的代码：</p>
<div>
<div>
<pre style="font-family: monospace"><span style="color: #cc00cc">#sidebar</span> &amp;gt<span style="color: #00aa00">;</span> h2 <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">margin-top</span><span style="color: #00aa00">:</span> <span style="color: #933">10px</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span>
&nbsp;
<span style="color: #cc00cc">#sidebar</span> &amp;gt<span style="color: #00aa00">;</span> h2<span style="color: #3333ff">:first-child </span><span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">margin-top</span><span style="color: #00aa00">:</span> <span style="color: #cc66cc">0</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<h5>浏览器兼容性</h5>
<p>IE6 不支持 :first-child 伪类。根据伪类应用到的设计的不同，它或许不会成为关注的主要问题。比如，如果你使用:first-child 选择器来移除标题或段落上的头部或底部的间距，你的布局在IE6中不会坏掉，它只会看起来有些不同。但是如果你使用:first-child选择器从一个，比如浮动元素，移除左边距或右边距，将会让你的设计乱掉。</p>
<h4>语言伪类</h4>
<p>语言伪类<strong>:lang()</strong>，允许你匹配一个基于它的语言的元素。</p>
<p>你如，你想让你的网站的某个特定的链接根据页面的语言有不同的背景颜色：</p>
<div>
<div>
<pre style="font-family: monospace"><span style="color: #00aa00">:</span>lang<span style="color: #00aa00">(</span>en<span style="color: #00aa00">)</span> &amp;gt<span style="color: #00aa00">;</span> a<span style="color: #cc00cc">#flag</span> <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">background-image</span><span style="color: #00aa00">:</span> <span style="color: #993333">url</span><span style="color: #00aa00">(</span><span style="color: #ff0000; font-style: italic">english.gif</span><span style="color: #00aa00">)</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span>
&nbsp;
<span style="color: #00aa00">:</span>lang<span style="color: #00aa00">(</span>fr<span style="color: #00aa00">)</span> &amp;gt<span style="color: #00aa00">;</span> a<span style="color: #cc00cc">#flag</span> <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">background-image</span><span style="color: #00aa00">:</span> <span style="color: #993333">url</span><span style="color: #00aa00">(</span><span style="color: #ff0000; font-style: italic">french.gif</span><span style="color: #00aa00">)</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>这个选择器将会匹配相关的链接&mdash;&mdash;如果页面的语言等于&ldquo;en&rdquo;或&ldquo;fr&rdquo;，或者以&ldquo;en&rdquo;或&ldquo;fr&rdquo;开头并在后面带个连字符&ldquo;-&rdquo;的话。</p>
<h5>浏览器兼容性</h5>
<p>不幸的是，只有IE浏览器中只有IE8支持该选择器，其它的主要浏览器都支持该伪类选择器。</p>
<h3>5. CSS 3 伪类</h3>
<h4>:target</h4>
<p>当你使用锚点(片段标识符 fragment identifier)的时候，比如，http://www.smashingmagazine.com/2009/08/02/bauhaus-ninety-years-of-inspiration/#comments，这&ldquo;#comments&rdquo;就是一个片段标识符，你就可以使用:target伪类来控制目标的样式。</p>
<p>举个例子，比如你有一个很长的使用了很多文字和h2标题的页面，然后在页面的头部有一个对这些标题的索引。如果在点击索引内的某个链接时，相应的标题以某种方式高亮，然后滚动到相应的位置，对读者就会很有用。很简单。</p>
<div>
<div>
<pre style="font-family: monospace">
h2<span style="color: #3333ff">:target </span><span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">background</span><span style="color: #00aa00">:</span> <span style="color: #cc00cc">#F2EBD6</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<h5>浏览器兼容性</h5>
<p>这一次，IE浏览器完全不支持:target伪类，另一个小问题就是Opera 在使用&ldquo;前进&rdquo;和后退按钮时不支持该选择器。但是其它的各个主流浏览器都支持该选择器。</p>
<h4>UI元素状态伪类</h4>
<p>有些HTML元素有enable 或disabled 状态(比如，文本输入框)和 checked 或unchecked 状态(单选按钮和复选框)。这些状态就可以使用<strong>:enabled</strong>、<strong>:disabled</strong> 或<strong>:checked</strong> 伪类来分别定位。</p>
<p>那么你就会想，如果任意一个禁用的(disabled)文本框应该使用浅灰色的背景和虚线边框：</p>
<div>
<div>
<pre style="font-family: monospace">
input<span style="color: #3333ff">:disabled </span><span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">border</span><span style="color: #00aa00">:</span><span style="color: #933">1px</span> <span style="color: #993333">dotted</span> <span style="color: #cc00cc">#999</span><span style="color: #00aa00">;</span>
	<span style="font-weight: bold; color: #000000">background</span><span style="color: #00aa00">:</span><span style="color: #cc00cc">#F2F2F2</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>你也可能会想让所有选中的复选框有个左边距(这样就可以在众多的复选框中很容易认出来)：</p>
<div>
<div>
<pre style="font-family: monospace">
input<span style="color: #00aa00">[</span>type<span style="color: #00aa00">=</span>&rdquo;checkbox&rdquo;<span style="color: #00aa00">]</span><span style="color: #3333ff">:checked </span><span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">margin-left</span><span style="color: #00aa00">:</span> <span style="color: #933">15px</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<h5>浏览器兼容性</h5>
<p>所有的主流浏览器，除了我们常常不报希望的IE系列浏览器，都支持UI元素状态伪类。如果你考虑只是<strong>添加附加级别的细节</strong>和增强网站的可用性，这个仍然是可以采用的。</p>
<h3>6. CSS 3 结构伪类</h3>
<h4>:nth-child</h4>
<p>:nth-child()伪类允许你<strong>定位某个父级元素的一个或多个特定的子元素</strong>.</p>
<p>你可以通过定义它的值为一个<strong>整数</strong>来定位某个单个子元素：</p>
<div>
<div>
<pre style="font-family: monospace">
ul li<span style="color: #3333ff">:nth-</span>child<span style="color: #00aa00">(</span><span style="color: #cc66cc">3</span><span style="color: #00aa00">)</span> <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">color</span><span style="color: #00aa00">:</span> <span style="color: #993333">red</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>这将会让ul元素的第三个li元素的文字变成红色。注意如果在ul里面有个其它类型的元素(不是li)，它也会算作其子元素。</p>
<p>你可以<strong>使用表达式</strong>来定位子元素。比如，下面的表达式将从第四个开始匹配每第三个元素。</p>
<div>
<div>
<pre style="font-family: monospace">
ul li<span style="color: #3333ff">:nth-</span>child<span style="color: #00aa00">(</span>3n<span style="color: #00aa00">+</span><span style="color: #cc66cc">4</span><span style="color: #00aa00">)</span> <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">color</span><span style="color: #00aa00">:</span> <span style="color: #993333">yellow</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>在上面的这个例子中，第一个黄色的li元素将会是第四个。如果也想从第一个开始匹配，你可以使用一个简单的表达式：</p>
<div>
<div>
<pre style="font-family: monospace">
ul li<span style="color: #3333ff">:nth-</span>child<span style="color: #00aa00">(</span>3n<span style="color: #00aa00">)</span> <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">color</span><span style="color: #00aa00">:</span> <span style="color: #993333">yellow</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>这样的话，第一个黄色的li元素将会是第三个子元素，然后是它后面的每隔第三个。现在想象一下如果你只想匹配列表中的<strong>前四个子</strong>元素：</p>
<div>
<div>
<pre style="font-family: monospace">
ul li<span style="color: #3333ff">:nth-</span>child<span style="color: #00aa00">(</span>-n<span style="color: #00aa00">+</span><span style="color: #cc66cc">4</span><span style="color: #00aa00">)</span> <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">color</span><span style="color: #00aa00">:</span> <span style="color: #993333">green</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>:nth-child的值同样也可以被定义为<strong>&ldquo;even&rdquo; 或&ldquo;odd&rdquo;</strong>，和&ldquo;2n&rdquo; (第偶数个) 或&ldquo;2n+1&rdquo; (第奇数个)的效果是一样的。</p>
<h4>:nth-last-child</h4>
<p>:nth-last-child伪类基本上和:nth-child伪类的作用相同，但是它<strong>从最后一个元素开始</strong>算。</p>
<p>使用上面的一个例子来看看：</p>
<div>
<div>
<pre style="font-family: monospace">
ul li<span style="color: #3333ff">:nth-</span>child<span style="color: #00aa00">(</span>-n<span style="color: #00aa00">+</span><span style="color: #cc66cc">4</span><span style="color: #00aa00">)</span> <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">color</span><span style="color: #00aa00">:</span> <span style="color: #993333">green</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>不是匹配最前面的四个li元素，该选择器匹配最后面的四个元素。</p>
<p>你同样可以使用&ldquo;even&rdquo; 或&ldquo;odd&rdquo;只，同样与nth-child不同的是，这是从最后面的元素开始算的：</p>
<div>
<div>
<pre style="font-family: monospace">
ul li<span style="color: #3333ff">:nth-last-</span>child<span style="color: #00aa00">(</span>odd<span style="color: #00aa00">)</span> <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">color</span><span style="color: #00aa00">:</span> grey<span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<h4>:nth-of-type</h4>
<p>:nth-of-type伪类和:nth-child也很像，不同的是它只计算选择器中指定的那个元素。</p>
<p>这对定位元素中包含大量不同的元素的情况会很有用。比如，我们想控制一个文本块中的每隔一个段落，但是我们又想要无视其它元素比如图片和引用块：</p>
<div>
<div>
<pre style="font-family: monospace">
p<span style="color: #3333ff">:nth-of-</span>type<span style="color: #00aa00">(</span>even<span style="color: #00aa00">)</span> <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">color</span><span style="color: #00aa00">:</span> <span style="font-weight: bold; color: #000000">blue</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>你也可以使用一些值，就像在:nth-child中使用的一样。</p>
<h4>:nth-last-of-type</h4>
<p>你能猜到它吧？！:nth-last-of-type 伪类可以<strong>像前面提到的:nth-last-child一样使用</strong>，但是这次，它将之匹配你在选择器中指定的元素类型：</p>
<div>
<div>
<pre style="font-family: monospace">
ul li<span style="color: #3333ff">:nth-last-of-</span>type<span style="color: #00aa00">(</span>-n<span style="color: #00aa00">+</span><span style="color: #cc66cc">4</span><span style="color: #00aa00">)</span> <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">color</span><span style="color: #00aa00">:</span> <span style="color: #993333">green</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>我们可以更加的聪明一些，在一个大的块级选择器中<strong>结合多种这样的伪类</strong>。比如我们想让文章中的所有的图片左浮动，除了第一个和最后一个(我们可以假设他们是满宽的，无须浮动)：</p>
<div>
<div>
<pre style="font-family: monospace"><span style="color: #6666ff">.post</span> img<span style="color: #3333ff">:nth-of-</span>type<span style="color: #00aa00">(</span>n<span style="color: #00aa00">+</span><span style="color: #cc66cc">2</span><span style="color: #00aa00">)</span><span style="color: #3333ff">:nth-last-of-</span>type<span style="color: #00aa00">(</span>n<span style="color: #00aa00">+</span><span style="color: #cc66cc">2</span><span style="color: #00aa00">)</span> <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">float</span><span style="color: #00aa00">:</span> <span style="font-weight: bold; color: #000000">left</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>所以在这个选择器的第一部分，我们从第二个图片开始定位每一个图片。在第二部分中，我们定位所有的图片，除了最后一个。因为这两个选择器并非互斥的，我们可以同时使用它们，这样就可以一下子排除第一个和最后一个元素！</p>
<h4>:last-child</h4>
<p>:last-child伪类的作用类似于:first-child 伪类，但是会定位<strong>父级元素的最后一个子元素</strong>。</p>
<p>让我们假设你不想让你的日志的div的最后一个段落也有一个底部边距：</p>
<div>
<div>
<pre style="font-family: monospace"><span style="color: #6666ff">.post</span> &amp;gt<span style="color: #00aa00">;</span> p<span style="color: #3333ff">:last-child </span><span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">margin-bottom</span><span style="color: #00aa00">:</span> <span style="color: #cc66cc">0</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>该选择器将定位class为&rdquo;post&rdquo;的元素的最后一个直接子级段落。</p>
<h4>:first-of-type 和:last-of-type</h4>
<p>:first-of-type 伪类用于定位一个<strong>父级元素下的第一个同类子元素</strong>。</p>
<p>比如，你可以定位某个特定的div的第一个子级段落(p)，并让其第一行字母大写:</p>
<div>
<div>
<pre style="font-family: monospace"><span style="color: #6666ff">.post</span> &amp;gt<span style="color: #00aa00">;</span> p<span style="color: #3333ff">:first-of-type</span><span style="color: #3333ff">:first-line </span><span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">font-variant</span><span style="color: #00aa00">:</span> <span style="color: #993333">small-caps</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>在这个选择器中，你可以确定你是在只定位class为&rdquo;post&rdquo;的元素的直接子级p元素，而且还是匹配第一个子级p元素。</p>
<p>:last-of-type伪类与此类似，只是匹配最后一个子元素。</p>
<h4><img alt=":o" src="http://www.qianduan.net/wp-includes/images/smilies/icon_surprised.gif" /> nly-child</h4>
<p><img alt=":o" src="http://www.qianduan.net/wp-includes/images/smilies/icon_surprised.gif" /> nly-child伪类表示一个元素是它的父级元素的<strong>唯一一个子元素</strong>。</p>
<p>比如说，你有一些盒子(&ldquo;news&rdquo;)，里面有一些文字段落，当你有多于一个段落的时候，你想让文字比只有一个段落的时候小一些：</p>
<div>
<div>
<pre style="font-family: monospace">
div<span style="color: #6666ff">.news</span> &amp;gt<span style="color: #00aa00">;</span> p <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">font-size</span><span style="color: #00aa00">:</span> <span style="color: #933">1.2em</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span>
&nbsp;
div<span style="color: #6666ff">.news</span> &amp;gt<span style="color: #00aa00">;</span> p<span style="color: #3333ff"> <img src='http://www.movinghorse.cn/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> nly-child </span><span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">font-size</span><span style="color: #00aa00">:</span> <span style="color: #933">1.5em</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>第一个选择器中，我们定义&rdquo;news&rdquo;div的所有子级p元素的字体大小。在第二个中，我们覆盖之前的字体大小，如果该p元素是&ldquo;news&rdquo; div的唯一子元素的时候，它的字体大小会比较大一些。</p>
<h4><img alt=":o" src="http://www.qianduan.net/wp-includes/images/smilies/icon_surprised.gif" /> nly-of-type</h4>
<p><img alt=":o" src="http://www.qianduan.net/wp-includes/images/smilies/icon_surprised.gif" /> nly-of-type伪类表示一个元素是<strong>它的父级元素的唯一一个相同类型的子元素</strong>。</p>
<p>这有用什么用？假设你有一些日志，每一篇都有个class为&rdquo;post&rdquo;的div，他们中的一些有多于一张图片，但是有些可能就只有一张图片。你想让后者中的图片水平居中，而在其它的有多于一张图片的日志中，就将它左浮动。这个需求用这个选择器就很容易实现：</p>
<div>
<div>
<pre style="font-family: monospace"><span style="color: #6666ff">.post</span> &amp;gt<span style="color: #00aa00">;</span> img <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">float</span><span style="color: #00aa00">:</span> <span style="font-weight: bold; color: #000000">left</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span>
&nbsp;
<span style="color: #6666ff">.post</span> &amp;gt<span style="color: #00aa00">;</span> img<span style="color: #3333ff"> <img src='http://www.movinghorse.cn/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> nly-of-type </span><span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">float</span><span style="color: #00aa00">:</span> <span style="color: #993333">none</span><span style="color: #00aa00">;</span>
	<span style="font-weight: bold; color: #000000">margin</span><span style="color: #00aa00">:</span> <span style="color: #993333">auto</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<h4>:empty</h4>
<p>:empty伪类表示<strong>一个元素里面没有任何内容</strong>。</p>
<p>这个选择器可以用很多种用途。比如，你在你的&ldquo;sidebar&rdquo;中有若干个盒子，但是不想让空盒子显示出来：</p>
<div>
<div>
<pre style="font-family: monospace"><span style="color: #cc00cc">#sidebar</span> <span style="color: #6666ff">.box</span><span style="color: #3333ff">:empty </span><span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">display</span><span style="color: #00aa00">:</span> <span style="color: #993333">none</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>注意，就算&rdquo;box&rdquo;div里面只有一个空格，它也不会被css当作空标签的，这样就不能匹配该选择器了。</p>
<h4>浏览器支持</h4>
<p>Internet Explorer (直到8.0版本)都不支持结构伪类。Firefox、Safari 和Opera 在其最新版本的浏览器中指出这些选择器。这意味着，使用这些选择器对<strong>网站的可用性和可访问性</strong>是很有用的，或者如果网站的用户中的大部分是使用IE而且你不想在某些细节上无视他们，最好还是保持使用通用的class和简单的选择器来迎合这些选择器。否则你会被搞疯的！</p>
<h3>7. 否定选择器</h3>
<p>否定选择器<strong>:not()</strong>，可以让你定位<strong>不匹配</strong>该选择器的元素</p>
<p>比如，如果你需要定义表单元素中的input元素，但是又不想包括submit类型的input的时候会灰常有用&mdash;&mdash;你想它们有不同的样式，以看起来像按钮：</p>
<div>
<div>
<pre style="font-family: monospace">
input<span style="color: #00aa00">:</span>not<span style="color: #00aa00">(</span><span style="color: #00aa00">[</span>type<span style="color: #00aa00">=</span><span style="color: #ff0000">&quot;submit&quot;</span><span style="color: #00aa00">]</span><span style="color: #00aa00">)</span> <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">width</span><span style="color: #00aa00">:</span> <span style="color: #933">200px</span><span style="color: #00aa00">;</span>
	<span style="font-weight: bold; color: #000000">padding</span><span style="color: #00aa00">:</span> <span style="color: #933">3px</span><span style="color: #00aa00">;</span>
	<span style="font-weight: bold; color: #000000">border</span><span style="color: #00aa00">:</span> <span style="color: #933">1px</span> <span style="color: #993333">solid</span> <span style="color: #cc00cc">#000000</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>另一个例子，你想你的日志的div中的所有段落(p)有比较大的字体，除了表示时间和日期的段落：</p>
<div>
<div>
<pre style="font-family: monospace"><span style="color: #6666ff">.post</span> p<span style="color: #00aa00">:</span>not<span style="color: #00aa00">(</span>.date<span style="color: #00aa00">)</span> <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">font-size</span><span style="color: #00aa00">:</span> <span style="color: #933">13px</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>你可以想象这个选择器能带给你的潜力了吧，你能够从你的CSS文件中剥离(剔除)的无用的大量选择器也被它广泛支持吗？</p>
<h4>浏览器支持</h4>
<p>Internet Explorer在这里常常是让我们感到扫兴的东西：一点都不支持，甚至在IE8中。这大概意味着这些选择器将仍不得不等到一些开发者开始不再顾虑将它添加到他们的样式表中才会普及。</p>
<h3>8. 伪元素</h3>
<p>伪元素允许你操作<strong>HTML中不是真实存在的元素</strong>，比如一个文本块的第一行或者第一个字母。</p>
<p>伪元素在CSS 2.1中就已经存在，但是CSS 3说明书表示他们应该使用双冒号&ldquo;::&rdquo;，以与伪类区分开来。在CSS 2.1中，他们也是使用单个冒号&ldquo;:&rdquo;的。浏览器会将能够接受两种格式，除非这些伪元素只存在于CSS3中。</p>
<h4>::first-line</h4>
<p>::first-line伪元素将匹配block、inline-block、table-caption、table-cell等等级别元素的<strong>第一行</strong></p>
<p>这对在你的文字块上添加<strong>一些微妙的排版细节</strong>相当有用，比如，将一片文章的第一行文字改成小写字母：</p>
<div>
<div>
<pre style="font-family: monospace">
h1 <span style="color: #00aa00">+</span> p<span style="color: #00aa00">:</span><span style="color: #3333ff">:first-line </span><span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">font-variant</span><span style="color: #00aa00">:</span> <span style="color: #993333">small-caps</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>如果你专心的阅读了我们前面的内容，你将会了解到上面的语法意味着，紧紧的跟在H1标签之后(+)的段落会将其第一行文字显示为小写字母。</p>
<p>你也可以针对相关的div的第一行，而不用针对实际的段落标签(p):</p>
<div>
<div>
<pre style="font-family: monospace">
div<span style="color: #6666ff">.post</span> p<span style="color: #00aa00">:</span><span style="color: #3333ff">:first-line </span><span style="color: #00aa00">{</span> <span style="font-weight: bold; color: #000000">font-variant</span><span style="color: #00aa00">:</span> <span style="color: #993333">small-caps</span><span style="color: #00aa00">;</span> <span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>或者更进一步，定位某个特低的div的第一个段落的第一行：</p>
<div>
<div>
<pre style="font-family: monospace">
div<span style="color: #6666ff">.post</span> &amp;gt<span style="color: #00aa00">;</span> p<span style="color: #3333ff">:first-child</span><span style="color: #00aa00">:</span><span style="color: #3333ff">:first-line </span><span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">font-variant</span><span style="color: #00aa00">:</span> <span style="color: #993333">small-caps</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>这里，&ldquo;&gt;&rdquo;符号表示你指定的是post div的直接子级元素，这样如果段落被包括在第二级div中，它就不会匹配这个选择器。</p>
<h4>::first-letter</h4>
<p>::first-letter伪元素将会匹配一个文本块的<strong>第一个字母</strong>，除非在同一行里面包含一些其它元素，比如图片。</p>
<p>和::first-line伪类一样，::first-letter通常用于给文本元素<strong>添加排版细节</strong>，比如下沉字母或首字母。</p>
<p>这里是如何使用::first-letter伪元素创建<strong>首字下沉</strong>的例子:</p>
<div>
<div>
<pre style="font-family: monospace">
p <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">font-size</span><span style="color: #00aa00">:</span> <span style="color: #933">12px</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span>
&nbsp;
p<span style="color: #00aa00">:</span><span style="color: #3333ff">:first-letter </span><span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">font-size</span><span style="color: #00aa00">:</span> <span style="color: #933">24px</span><span style="color: #00aa00">;</span>
	<span style="font-weight: bold; color: #000000">float</span><span style="color: #00aa00">:</span> <span style="font-weight: bold; color: #000000">left</span><span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>注意如果你在某些元素中同时使用::first-line 和::first-letter ，::first-letter 属性将覆盖从::first-line中继承下来的某些属性。</p>
<p>如果你不知道W3C规则的话，这个元素有时会产生意想不到的结果：它事实上是使用最长的规则的选择器！所以如果你计划使用它的话<strong>最好仔细的阅读一下</strong> (其它选择器也一样)。</p>
<h4>::before 和 ::after</h4>
<p>::before和::after 伪元素用于在一个元素的前面或后面<strong>插入内容</strong>，纯CSS方法。</p>
<p>这些元素将继承它们将附加的元素的大部分属性。</p>
<p>假设你想在你的页面中的图标的描述前面添加文字&ldquo;Graphic number x:&rdquo;。你将无需写文字&ldquo;Graphic number&rdquo;，或者自己手动添加数字：</p>
<div>
<div>
<pre style="font-family: monospace"><span style="color: #6666ff">.post</span> <span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">counter-reset</span><span style="color: #00aa00">:</span> image<span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span>
&nbsp;
p<span style="color: #6666ff">.description</span><span style="color: #00aa00">:</span><span style="color: #3333ff">:before </span><span style="color: #00aa00">{</span>
	<span style="font-weight: bold; color: #000000">content</span><span style="color: #00aa00">:</span> <span style="color: #ff0000">&quot;Figure number &quot;</span> counter<span style="color: #00aa00">(</span>image<span style="color: #00aa00">)</span> <span style="color: #ff0000">&quot;: &quot;</span><span style="color: #00aa00">;</span>
	<span style="font-weight: bold; color: #000000">counter-increment</span><span style="color: #00aa00">:</span> image<span style="color: #00aa00">;</span>
	<span style="color: #00aa00">}</span></pre>
</div>
</div>
<p>那么这会产生什么？</p>
<p>首先，我们告诉HTML来<strong>创建&ldquo;image&rdquo;计数器</strong>。比如我们可以添加该属性到页面的body。同样我们也可以给该计数器起任何一个名字，只要你想，只要我们常常使用同样的名字引用它：自己试试吧！</p>
<p>那么我们想在class为&rdquo;description&rdquo;的每一个段落之前添加这一块内容: &ldquo;Figure number &rdquo; &mdash; 注意只有我们在引号里面写的内容才会被创建到页面中，所以我们也要添加一个空格！</p>
<p>然后，我们就有了counter(image):这将用到我们之前在.post选择器中定义的属性。它默认会从数字1开始。</p>
<p>下一个属性在那里表示计数器知道对于每一个p.description，它需要将image计数器增加1 (counter-increment: image)。</p>
<p>它并不像看起来的那么复杂，而且还会灰常的有用。</p>
<p>::before和::after伪元素常常只<strong>使用content属性</strong>，来添加一些短语或排版元素，但是这里我们展示了我们如果以一种更加强大的结合counter-reset和counter-increment属性的方式来使用它们。</p>
<p><strong>有趣的是:</strong> ::first-line 和::first-letter 伪元素可以匹配使用::before伪元素生成的内容，如果存在的话。</p>
<h4>浏览器支持</h4>
<p>如果使用单个冒号的话(比如, :first-letter, 而不是::first-letter)，这些伪元素被IE8支持(但是不被IE7或6支持)。但是左右其他的主流浏览器都支持这些选择器。</p>
<h3>结语</h3>
<p>乏味的讲述终于结束了，现在该你来领悟本文的要义并<strong>自己尝试了</strong>: 开始通过创建实验性的页面并测试所有的这些选择器，在有疑问的时候返回这里并确保总是遵循W3C的规则，但是请不要只是坐在那里想这些选择器尚未被完全支持你就无视它们。</p>
<p>如果你<strong>敢于冒险</strong>，或者你不害怕放弃之前的遍地无用和非语义化的class和id，为什么不尝试一两个这些强大的CSS选择器到你的下一个项目中呢？我们保证你不会回头的！</p>
<h3>参考</h3>
<ul>
<li><a href="http://www.w3.org/TR/CSS2/selector.html" target="_blank" closure_hashcode_z9wadg="1818">CSS 2 Selectors &mdash; W3C</a></li>
<li><a href="http://www.w3.org/TR/css3-selectors/" target="_blank" closure_hashcode_z9wadg="1819">CSS 3 Selectors Level 3 &mdash; W3C</a></li>
<li><a href="http://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28Cascading_Style_Sheets%29" target="_blank" closure_hashcode_z9wadg="1820">Comparison of layout engines (Cascading Style Sheets) &mdash; Wikipedia</a></li>
<li><a href="http://www.w3.org/TR/CSS2/generate.html" target="_blank" closure_hashcode_z9wadg="1821">Generated content, automatic numbering, and lists &mdash; W3C</a></li>
</ul>
<h3>扩展资源</h3>
<ul>
<li><a href="http://www.alistapart.com/articles/keepelementskidsinlinewithoffspring/" target="_blank" closure_hashcode_z9wadg="1822">Keeping Your Elements&rsquo; Kids in Line with Offspring &mdash; A List Apart</a></li>
<li><a href="http://css.maxdesign.com.au/selectutorial/index.htm" target="_blank" closure_hashcode_z9wadg="1823">Selectutorial &ndash; CSS selectors </a></li>
<li><a href="http://inspectelement.com/tutorials/a-look-at-some-of-the-new-selectors-introduced-in-css3/" target="_blank" closure_hashcode_z9wadg="1824">A Look at Some of the New Selectors Introduced in CSS3</a></li>
<li>CSS 2.1 selectors, <a href="http://www.456bereastreet.com/archive/200509/css_21_selectors_part_1/" target="_blank" closure_hashcode_z9wadg="1825">Part 1</a> and <a href="http://www.456bereastreet.com/archive/200510/css_21_selectors_part_2/" target="_blank" closure_hashcode_z9wadg="1826">Part 2</a></li>
<li><a href="http://www.456bereastreet.com/archive/200601/css_3_selectors_explained/" target="_blank" closure_hashcode_z9wadg="1827">CSS 3 selectors explained</a></li>
<li><a href="http://kimblim.dk/css-tests/selectors/" target="_blank" closure_hashcode_z9wadg="1828">CSS selectors and pseudo selectors browser compatibility</a></li>
<li><a href="http://www.impressivewebs.com/10-useful-css-properties-not-supported-by-internet-explorer/" target="_blank" closure_hashcode_z9wadg="1829">10 Useful CSS Properties Not Supported By Internet Explorer</a></li>
<li><a href="http://webdesignernotebook.com/css/styling-a-poem-with-advanced-css-selectors/" target="_blank" closure_hashcode_z9wadg="1830">Styling a Poem with Advanced CSS Selectors</a></li>
</ul>
<h3>关于作者</h3>
<p><a href="http://yaili.com/" target="_blank" closure_hashcode_z9wadg="1831">Inayaili de Le&oacute;n</a> 是一个葡萄牙网页设计师。她对网页设计和前端编码有特别的爱好，而且喜欢漂亮和间接的网站。她居住在伦敦。你可以在<a href="http://webdesignernotebook.com/" target="_blank" closure_hashcode_z9wadg="1832">Web Designer Notebook</a>看到她的更多文章并<a href="http://twitter.com/yaili" target="_blank" closure_hashcode_z9wadg="1833">follow her on Twitter</a>。</p>
<hr />
<p><small>© 行骏 for <a href="http://www.movinghorse.cn">行骏-IT Player</a>, 2009. |
<a href="http://www.movinghorse.cn/2009/09/01/study-adcenced-css-selector/">Permalink</a> |
<a href="http://www.movinghorse.cn/2009/09/01/study-adcenced-css-selector/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.movinghorse.cn/2009/09/01/study-adcenced-css-selector/&title=征服高级CSS选择器">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.movinghorse.cn/2009/09/01/study-adcenced-css-selector/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>好好看看这三十条，努力去做</title>
		<link>http://www.movinghorse.cn/2009/08/28/work-hard-with-30-rule/</link>
		<comments>http://www.movinghorse.cn/2009/08/28/work-hard-with-30-rule/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 15:37:16 +0000</pubDate>
		<dc:creator>行骏</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://movinghorse.cn/default.asp?id=263</guid>
		<description><![CDATA[1、一个年轻人，如果三年的时间里，没有任何想法，他这一生，就基本这个样子，没有多大改变了。&#160;&#160; &#160; &#160; 2、成功者就是胆识加魄力，曾经在火车上听人谈起过温州人的成功，说了这么三个字，&#8220;胆子大&#8221;。这其实，就是胆识，而拿得起，放得下，就是魄力。&#160;&#160; &#160; &#160; 3、这个世界，有这么一小撮的人，打开报纸，是他们的消息，打开电视，是他们的消息，街头巷尾，议论的是他们的消息，仿佛世界是为他们准备的，他们能够呼风唤雨，无所不能。你的目标，应该是努力成为这一小撮人。&#160;&#160; &#160; &#160; 4、如果，你真的爱你的爸妈，爱你的女朋友，就好好的去奋斗，去拼搏吧，这样，你才有能力，有经济条件，有自由时间，去陪他们，去好好爱他们。&#160;&#160; &#160; &#160; 5、这个社会，是快鱼吃慢鱼，而不是慢鱼吃快鱼。&#160;&#160; &#160; &#160; 6、这个社会，是赢家通吃，输者一无所有，社会，永远都是只以成败论英雄。&#160;&#160; &#160; &#160; 7、如果你问周围朋友词语，如果十个人，九个人说不知道，那么，这是一个机遇，如果十个人，就个人都知道了，就是一个行业。&#160;&#160; &#160; &#160; 8、任何一个行业，一个市场，都是先来的有肉吃，后来的汤都没的喝。&#160;&#160; &#160; &#160; 9、这个世界上，一流的人才，可以把三流项目做成二流或更好，但是，三流人才，会把一流项目，做的还不如三流。&#160;&#160; &#160; &#160; 10、趁着年轻，多出去走走看看。读万卷书，不如行万里路，行万里路，不如阅人无数。&#160;&#160; &#160; &#160; 11、与人交往的时候，多听少说。这就是，上帝为什么给我们一个嘴巴两个耳朵的原因。&#160;&#160; &#160; &#160; 12、记得，要做最后出牌的人，出让别人觉得出其不意的牌，在他们以为你要输掉的时候，这样，你才能赢得牌局。&#160;&#160; &#160; &#160; 13、不要装大，对于装大的人，最好的办法就是，捡块砖头，悄悄跟上去，一下子从背后放倒他。&#160;&#160; &#160; &#160; 14、不要随便说脏话，这会让别人觉得你没涵养，不大愿意和你交往。即使交往，也是敷衍。因为他内心认定你素质很差。&#160;&#160; &#160; &#160; 15、想要抽烟的时候，先问下周围的人可不可以，要学会尊重别人。少在女生面前耍酷抽烟，你不知道，其实她们内心很反感。 16、买衣服的时候，要自己去挑，不要让家人给你买，虽然你第一第二次买的都不怎么样，可是，你会慢慢有眼光的。&#160;&#160; &#160; &#160; 17、要想进步，就只有吸取教训，成功的经验都是歪曲的，成功了，想怎么说都可以，失败者没有发言权，可是，你可以通过他的事例反思，总结。教训，不仅要从自己身上吸取，还要从别人身上吸取。&#160;&#160; &#160; &#160; 18、学习，学习，再学习，有事没事，去书店看看书，关于管理，金融，营销，人际交往，未来趋势等这些，你能获得很多。这个社会竞争太激烈了，你不学习，就会被淘汰。中国2008底，有一百多万大学生找不到工作。竞争这么激烈，所以，一定要认识一点，大学毕业了，不是学习结束了，而是学习刚刚开始。还有，我个人推荐一个很好的视频节目，《谁来一起午餐》。&#160;&#160; &#160; &#160; 19、如果你不是歌手，不是画家，也不是玩行为艺术的，那么，请在平时注意你的衣着。现在这个社会，衣着能表现出你属于哪一个群体，哪一个圈子。&#160;&#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: Verdana">1、一个年轻人，如果三年的时间里，没有任何想法，他这一生，就基本这个样子，没有多大改变了。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 2、成功者就是胆识加魄力，曾经在火车上听人谈起过温州人的成功，说了这么三个字，&ldquo;胆子大&rdquo;。这其实，就是胆识，而拿得起，放得下，就是魄力。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 3、这个世界，有这么一小撮的人，打开报纸，是他们的消息，打开电视，是他们的消息，街头巷尾，议论的是他们的消息，仿佛世界是为他们准备的，他们能够呼风唤雨，无所不能。你的目标，应该是努力成为这一小撮人。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 4、如果，你真的爱你的爸妈，爱你的女朋友，就好好的去奋斗，去拼搏吧，这样，你才有能力，有经济条件，有自由时间，去陪他们，去好好爱他们。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 5、这个社会，是快鱼吃慢鱼，而不是慢鱼吃快鱼。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 6、这个社会，是赢家通吃，输者一无所有，社会，永远都是只以成败论英雄。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 7、如果你问周围朋友词语，如果十个人，九个人说不知道，那么，这是一个机遇，如果十个人，就个人都知道了，就是一个行业。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 8、任何一个行业，一个市场，都是先来的有肉吃，后来的汤都没的喝。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 9、这个世界上，一流的人才，可以把三流项目做成二流或更好，但是，三流人才，会把一流项目，做的还不如三流。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 10、趁着年轻，多出去走走看看。读万卷书，不如行万里路，行万里路，不如阅人无数。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 11、与人交往的时候，多听少说。这就是，上帝为什么给我们一个嘴巴两个耳朵的原因。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 12、记得，要做最后出牌的人，出让别人觉得出其不意的牌，在他们以为你要输掉的时候，这样，你才能赢得牌局。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 13、不要装大，对于装大的人，最好的办法就是，捡块砖头，悄悄跟上去，一下子从背后放倒他。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 14、不要随便说脏话，这会让别人觉得你没涵养，不大愿意和你交往。即使交往，也是敷衍。因为他内心认定你素质很差。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 15、想要抽烟的时候，先问下周围的人可不可以，要学会尊重别人。少在女生面前耍酷抽烟，你不知道，其实她们内心很反感。 </span></p>
<p>16、买衣服的时候，要自己去挑，不要让家人给你买，虽然你第一第二次买的都不怎么样，可是，你会慢慢有眼光的。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 17、要想进步，就只有吸取教训，成功的经验都是歪曲的，成功了，想怎么说都可以，失败者没有发言权，可是，你可以通过他的事例反思，总结。教训，不仅要从自己身上吸取，还要从别人身上吸取。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 18、学习，学习，再学习，有事没事，去书店看看书，关于管理，金融，营销，人际交往，未来趋势等这些，你能获得很多。这个社会竞争太激烈了，你不学习，就会被淘汰。中国2008底，有一百多万大学生找不到工作。竞争这么激烈，所以，一定要认识一点，大学毕业了，不是学习结束了，而是学习刚刚开始。还有，我个人推荐一个很好的视频节目，《谁来一起午餐》。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 19、如果你不是歌手，不是画家，也不是玩行为艺术的，那么，请在平时注意你的衣着。现在这个社会，衣着能表现出你属于哪一个群体，哪一个圈子。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 20、记住，平均每天看电视超过三个小时以上的，一定都是那些月收入不超过两千元的，如果你想要月收入超过两千，请不要把时间浪费在电视上。同样的道理，那些平均每天玩网络游戏或聊天超过三个小时以上的，也都是那些月收入不超过两千的。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 21、因为穷人很多，并且穷人没有钱，所以，他们才会在网络上聊天抱怨，消磨时间。你有见过哪个企业老总或主管经理有事没事经常在QQ群里闲聊的？&nbsp;&nbsp;<br />
&nbsp; &nbsp; 22、无论你以后是不是从事销售部门，都看一下关于营销的书籍。因为，生活中，你处处都是在向别人推销展示你自己。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 23、平时的时候，多和你的朋友沟通交流一下，不要等到需要朋友的帮助时，才想到要和他们联系，到了社会，你才会知道，能够认识一个真正的朋友，有多难?&nbsp;&nbsp;<br />
&nbsp; &nbsp; 24、如果你想知道自己将来的年收入如何。找你最经常来往的六个朋友，把他们的年收入加起来，除以六，就差不多是你的了。这个例子，可以充分的说明一点，物以类聚。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 25、不要听信身边人的话，大一不谈恋爱，好的女孩子就被别人都挑走了。想想，刚上大一就耐不住寂寞，受不住诱惑，而去谈恋爱的女孩子，值得自己去追吗？大学里，可以有一场爱情，可是，不要固执地认为，刚上大一，就必须要谈恋爱。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 26、大学里不是一定要经历恋爱的，除了恋爱，还应该有其他更值得自己去做的事情，比如，去参加一些兼职或校内代理一些东西，去图书馆多看一些书，可以的话，去组织并领导一个团队，做点有意义的事情。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 27、关于爱情，有这么一句话，没有面包，怎么跳舞？无论什么时候，你决定去好好爱一个人的时候，一定要考虑给她你能给予的最好的物质生活。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 28、给自己定一个五年的目标，然后，把它分解成一年一年，半年半年的，三个月的，一个月的。这样，你才能找到自己的目标和方向。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 29、无论什么时候，记住尊严这两个字，做人是要有尊严，有原则，有底线的。否则，没有人会尊重你。&nbsp;&nbsp;<br />
&nbsp; &nbsp; 30、如果，我只能送你一句忠告，那就是，这个世界上没有免费的午餐，永远不要走捷径！</p>
<hr />
<p><small>© 行骏 for <a href="http://www.movinghorse.cn">行骏-IT Player</a>, 2009. |
<a href="http://www.movinghorse.cn/2009/08/28/work-hard-with-30-rule/">Permalink</a> |
<a href="http://www.movinghorse.cn/2009/08/28/work-hard-with-30-rule/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.movinghorse.cn/2009/08/28/work-hard-with-30-rule/&title=好好看看这三十条，努力去做">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.movinghorse.cn/2009/08/28/work-hard-with-30-rule/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>银者见银【转自阿里巴巴内网】</title>
		<link>http://www.movinghorse.cn/2009/08/18/sex-man-see-sex/</link>
		<comments>http://www.movinghorse.cn/2009/08/18/sex-man-see-sex/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 12:28:28 +0000</pubDate>
		<dc:creator>行骏</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://movinghorse.cn/default.asp?id=262</guid>
		<description><![CDATA[此图非同一般，据说是阿里巴巴中国站UED的团队T恤。。。。 银者见银，，，看你RP了。。。。 &#160; © 行骏 for 行骏-IT Player, 2009. &#124; Permalink &#124; No comment &#124; Add to del.icio.us Post tags: Feed enhanced by Better Feed from Ozh]]></description>
			<content:encoded><![CDATA[<p><img alt="" src="http://www.movinghorse.cn/attachments/month_0908/w200981820277.jpg" /></p>
<p>此图非同一般，据说是<span style="color: #ff0000">阿里巴巴中国站UED</span>的团队T恤。。。。</p>
<p>银者见银，，，看你RP了。。。。</p>
<p>&nbsp;</p>
<hr />
<p><small>© 行骏 for <a href="http://www.movinghorse.cn">行骏-IT Player</a>, 2009. |
<a href="http://www.movinghorse.cn/2009/08/18/sex-man-see-sex/">Permalink</a> |
<a href="http://www.movinghorse.cn/2009/08/18/sex-man-see-sex/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.movinghorse.cn/2009/08/18/sex-man-see-sex/&title=银者见银【转自阿里巴巴内网】">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.movinghorse.cn/2009/08/18/sex-man-see-sex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>朴慧京-我没有魅力</title>
		<link>http://www.movinghorse.cn/2009/08/16/prefect-song/</link>
		<comments>http://www.movinghorse.cn/2009/08/16/prefect-song/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 08:17:47 +0000</pubDate>
		<dc:creator>行骏</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://movinghorse.cn/default.asp?id=261</guid>
		<description><![CDATA[歌曲中文名:&#160;我没有魅力 歌手:&#160;朴慧京 音乐风格:&#160;流行 资源格式:&#160;MP3 版本:&#160;单曲 发行时间:&#160;2009年03月24日 地区:&#160;韩国 语言:&#160;朝鲜语 &#160; 韩国女歌手朴慧京《나 매력없니.. (feat. 상추(MM)) 我没有魅力(feat. 生菜(MM))》 어딜 가고 싶니 나도 가고 싶어 내 감정에 솔직한 나 매력없니 어떤 색이 좋아 나도 그게 좋아 내숭 없이 솔직한 내가 별로니 처음엔 너무 많은 걸 보여주지 말래 밀고 땡기기를 제대로 할 때 질리지 않고 오래 가는 것 그것이 LOVE [...]]]></description>
			<content:encoded><![CDATA[<p><img alt="朴慧京-我没有魅力" src="http://i459.photobucket.com/albums/qq316/movinghorse/a27f454a.jpg" /></p>
<div class="iptcom" id="iptcomCname"><span class="iptcom-title"><strong>歌曲中文名</strong>:&nbsp;</span>我没有魅力</div>
<div class="iptcom-multiline" id="iptcomActor"><span class="iptcom-title"><strong>歌手</strong>:&nbsp;</span><span class="iptcom-info">朴慧京</span></div>
<div class="iptcom" id="iptcomKind"><span class="iptcom-title"><strong>音乐风格</strong>:&nbsp;</span>流行</div>
<div class="iptcom" id="iptcomFiletype"><span class="iptcom-title"><strong>资源格式</strong>:&nbsp;</span>MP3</div>
<div class="iptcom" id="iptcomVersion"><span class="iptcom-title"><strong>版本</strong>:&nbsp;</span>单曲</div>
<div class="iptcom" id="iptcomTime"><span class="iptcom-title"><strong>发行时间</strong>:&nbsp;</span>2009年03月24日</div>
<div class="iptcom" id="iptcomCountry"><span class="iptcom-title"><strong>地区</strong>:&nbsp;</span>韩国</div>
<div class="iptcom" id="iptcomLanguage"><span class="iptcom-title"><strong>语言</strong>:&nbsp;</span>朝鲜语</div>
<div class="iptcom">&nbsp;</div>
<div class="iptcom"><strong><span style="font-size: 14px"><span><span style="color: #ff0000">韩国女歌手朴慧京《나 매력없니.. (feat. 상추(MM)) 我没有魅力(feat. 生菜(MM))》</span></span></span></strong></div>
<div class="iptcom">
<div class="f14" id="read_tpc">어딜 가고 싶니<br />
나도 가고 싶어<br />
내 감정에 솔직한<br />
나 매력없니<br />
어떤 색이 좋아<br />
나도 그게 좋아<br />
내숭 없이 솔직한<br />
내가 별로니<br />
처음엔 너무 많은 걸 보여주지 말래<br />
밀고 땡기기를 제대로 할 때<br />
질리지 않고 오래 가는 것<br />
그것이 LOVE 사랑이라고 사람들은 말해<br />
문자 메세지는 하루에 몇 번<br />
전화통화는 너무 길지 않게<br />
음 내 생각은 반대 쉿<br />
오 눈부신 날에<br />
오 해피한 날에 왜 서로를 감추니<br />
적당히 튕기며 줄다리기하는<br />
애가 타는 사랑 원하니<br />
오 너의 눈빛과<br />
오 너의 감정을 낭비하지 말아줘<br />
나에게만 줄래<br />
아쉬움이 남는 철없는<br />
사랑은 하지 말자<br />
뭐가 먹고 싶니<br />
같이 먹고 싶어<br />
너를 닮아 가는 게<br />
부담스럽니<br />
사랑이란<br />
머리로 푸는 수학이 아닌 감정<br />
사랑의 공식들은<br />
이별의 함정<br />
너의 감성의 니 몸을 맡겨<br />
한번도 상처받지 않은 것처럼<br />
입술로 약속하지 않아도<br />
가슴으로 믿는 벽에<br />
걸어두지 않고 매일 보고 쓰다듬고 있는<br />
세상 가장 아름다운<br />
오 눈부신 날에<br />
오 해피한 날에<br />
왜 서로를 감추니<br />
적당히 튕기며 줄다리기하는<br />
애가 타는 사랑 원하니<br />
오 너의 눈빛과<br />
오 너의 감정을 낭비하지 말아줘<br />
나에게만 줄래<br />
아쉬움이 남는 철없는<br />
사랑은 하지 말자<br />
나도 솔직한 니가 좋아<br />
이 세상 그 누구보다<br />
널 사랑해 널 사랑해<br />
항상 내 곁에 있어줘</p>
<p>오 눈부신 날에<br />
오 해피한 날에<br />
왜 서로를 감추니<br />
적당히 튕기며 줄다리기하는<br />
애가 타는 사랑 원하니<br />
오 나의 눈빛과<br />
오 나의 감정을<br />
허비하지 않을래<br />
너에게만 줄래<br />
아쉬움이 남는 철없는<br />
사랑은 안할꺼야<br />
&nbsp;</div>
</div>
<p><embed height="32" width="160" wmode="transparent" type="application/x-shockwave-flash" src="http://www.8box.cn/feed/000000_s_462960_/mini.swf"></embed></p>
<p>下载地址：<a href="http://www.rayfile.com/files/a8d045c7-8a3d-11de-b140-0014221b798a/">http://www.rayfile.com/files/a8d045c7-8a3d-11de-b140-0014221b798a/</a></p>
<hr />
<p><small>© 行骏 for <a href="http://www.movinghorse.cn">行骏-IT Player</a>, 2009. |
<a href="http://www.movinghorse.cn/2009/08/16/prefect-song/">Permalink</a> |
<a href="http://www.movinghorse.cn/2009/08/16/prefect-song/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.movinghorse.cn/2009/08/16/prefect-song/&title=朴慧京-我没有魅力">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.movinghorse.cn/2009/08/16/prefect-song/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>带着防毒面具工作，上班打CSS</title>
		<link>http://www.movinghorse.cn/2009/08/15/work-with-gas-mask/</link>
		<comments>http://www.movinghorse.cn/2009/08/15/work-with-gas-mask/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 06:32:28 +0000</pubDate>
		<dc:creator>行骏</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://movinghorse.cn/default.asp?id=260</guid>
		<description><![CDATA[此图仅供分享和传播 © 行骏 for 行骏-IT Player, 2009. &#124; Permalink &#124; 2 comments &#124; Add to del.icio.us Post tags: Feed enhanced by Better Feed from Ozh]]></description>
			<content:encoded><![CDATA[<p><img alt="alibaba" src="http://a.imagehost.org/0130/alibaba.jpg" /></p>
<p>此图仅供分享和传播</p>
<hr />
<p><small>© 行骏 for <a href="http://www.movinghorse.cn">行骏-IT Player</a>, 2009. |
<a href="http://www.movinghorse.cn/2009/08/15/work-with-gas-mask/">Permalink</a> |
<a href="http://www.movinghorse.cn/2009/08/15/work-with-gas-mask/#comments">2 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.movinghorse.cn/2009/08/15/work-with-gas-mask/&title=带着防毒面具工作，上班打CSS">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.movinghorse.cn/2009/08/15/work-with-gas-mask/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>网页缓存机制分析</title>
		<link>http://www.movinghorse.cn/2009/07/20/analysis-of-web-caching-mechanism/</link>
		<comments>http://www.movinghorse.cn/2009/07/20/analysis-of-web-caching-mechanism/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 12:24:27 +0000</pubDate>
		<dc:creator>行骏</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://movinghorse.cn/default.asp?id=259</guid>
		<description><![CDATA[最近在做一个项目，是关于页面提速的。页面提速的方法有很多，建议看看Yahoo!网站性能最佳体验的34条黄金守则，当然提速最明显的就是使用缓存，所以我们先关注缓存！ &#160;&#160;&#160; 五种常用于控制客户端缓存的头标 &#160;&#160;&#160; Last-Modified (最后修改时间)&#160; &#160;&#160;&#160;&#160;ETag (实体标签)&#160; &#160;&#160;&#160;&#160;Expires (有效指示) &#160;&#160;&#160; Pragma (编译指示)&#160; &#160;&#160;&#160;&#160;Cache-Control (缓存控制) &#160;&#160;&#160; Expires、Cache-Control、Last-Modified、ETag是RFC 2616（HTTP/1.1）协议中和网页缓存相关的几个字段。前两个用来控制缓存的失效日期，后两个用来验证网页的有效性。Pragma是HTTP/1.0中一个较弱的控制协议。 &#160;&#160;&#160; Expires字段声明了一个网页或URL地址不再被浏览器缓存的时间，一旦超过了这个时间，浏览器都应该联系原始服务器。RFC告诉我们：&#8220;由于推断的失效时间也许会降低语义透明度，应该被谨慎使用，同时我们鼓励原始服务器尽可能提供确切的失效时间。&#8221; &#160;&#160;&#160; 对于一般的纯静态页面，如html、gif、jpg、css、js，默认安装的Apache服务器，不会在响应头添加这个字段。Firefox浏览器接受到相应后，如果发现没有Expires字段，浏览器根据文件的类型和&#8220;Last-Modified&#8221;字段来推断出一个合适的失效时间，并存储在客户端。推测出的时间一般是接受到响应时间后的三天左右。 &#160;&#160;&#160; 对于动态页面，如果在页面内部没有通过函数强制加上Expires，例如header(&#8221;Expires: &#8221; . gmdate(&#8221;D, d M Y H:i:s&#8221;) . &#8221; GMT&#8221;)，Apache服务器会把Wed, 11 Jan 1984 05:00:00 GMT作为Expires字段内容，返回给浏览器。即认为动态页面总是失效的。而浏览器仍然会保存已经失效的动态页面。 &#160;&#160;&#160; 可以发现Firefox浏览器总是缓存所有页面，不管失效、不失效还是没有声明失效时间。即使缓存中声明了一个网页的实效日期是1970-01- 01 08:00:00，浏览器仍然会发送该文件在缓存中的Last-Modified和ETag字段。如果在服务器端验证通过，返回304状态，浏览器就还会使用此缓存。 &#160;&#160;&#160; Last-Modified这个头标是一个响应头标，表示客户端(通常指浏览器)所请求资源在服务器端的最后修改时间，通常情况下客户端在接受这个头标后，在以后对这个资源的请求会附带一个&#8217;If-Modified-Since&#8217;请求头标，而这个头标是想告诉服务器上次客户端所请求资源的最后修改时间，对于一些图像,css,js等静态文件资源，配置好了的apache服务器会理解这些If-Modified-Since请求头标，将头标里的时间和文件的最后修改时间进行比较并作出响应，如果二者相等则发送一个304 Not Modfied来告诉客户端所请求资源并未修改让客户端放心使用缓存中的资源，否则的话会重新发送一个新的资源和新的Last-Modified的头标。但是对于一个动态的PHP脚本，我们即使在脚本加入了header(&#8216;Last Modified: &#8216;.$time)来发送一个Last Modified响应头标，当客户端附带&#8217;If-Modified-Since&#8217;在次请求时apache服务器不会进行处理，这需要我们自己用$_SERVER['HTTP_IF_MODIFIED_SINCE']来获取&#8217;If-Modified-Since&#8217;的值自己来进行判断处理。 &#160;&#160;&#160;&#160; Cache-Control字段中可以声明多些元素，例如no-cache, must-revalidate, max-age=0等。这些元素用来指明页面被缓存最大时限，如何被缓存的，如何被转换到另一个不同的媒介，以及如何被存放在持久媒介中的。但是任何一个 Cache-Control指令都不能保证隐私性或者数据的安全性。&#8220;private&#8221;和&#8220;no-store&#8221;指令可以为隐私性和安全性方面提供一些帮助，但是他们并不能用于替代身份验证和加密。 [...]]]></description>
			<content:encoded><![CDATA[<p>最近在做一个项目，是关于页面提速的。页面提速的方法有很多，建议看看<a href="http://developer.yahoo.com/performance/rules.html" target="_blank"><font color="#006091">Yahoo!网站性能最佳体验的34条黄金守则</font></a>，当然提速最明显的就是使用缓存，所以我们先关注缓存！</p>
<div>&nbsp;&nbsp;&nbsp; 五种常用于控制客户端缓存的头标<br />
&nbsp;&nbsp;&nbsp; <strong>Last-Modified (最后修改时间)&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;ETag (实体标签)&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;Expires (有效指示) <br />
&nbsp;&nbsp;&nbsp; Pragma (编译指示)&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;Cache-Control (缓存控制) </strong></div>
<div><strong>&nbsp;&nbsp;&nbsp; Expires、Cache-Control、Last-Modified、ETag</strong>是RFC 2616（HTTP/1.1）协议中和网页缓存相关的几个字段。前两个用来控制缓存的失效日期，后两个用来验证网页的有效性。<strong>Pragma</strong>是HTTP/1.0中一个较弱的控制协议。</div>
<div>&nbsp;&nbsp;&nbsp; <strong>Expires</strong>字段声明了一个网页或URL地址不再被浏览器缓存的时间，一旦超过了这个时间，浏览器都应该联系原始服务器。RFC告诉我们：&ldquo;由于推断的失效时间也许会降低语义透明度，应该被谨慎使用，同时我们鼓励原始服务器尽可能提供确切的失效时间。&rdquo;</p>
<div>&nbsp;&nbsp;&nbsp; 对于一般的纯静态页面，如html、gif、jpg、css、js，默认安装的Apache服务器，不会在响应头添加这个字段。Firefox浏览器接受到相应后，如果发现没有Expires字段，浏览器根据文件的类型和&ldquo;Last-Modified&rdquo;字段来推断出一个合适的失效时间，并存储在客户端。推测出的时间一般是接受到响应时间后的三天左右。</div>
<div>
<div>&nbsp;&nbsp;&nbsp; 对于动态页面，如果在页面内部没有通过函数强制加上Expires，例如header(&rdquo;Expires: &rdquo; . gmdate(&rdquo;D, d M Y H:i:s&rdquo;) . &rdquo; GMT&rdquo;)，Apache服务器会把Wed, 11 Jan 1984 05:00:00 GMT作为Expires字段内容，返回给浏览器。即认为动态页面总是失效的。而浏览器仍然会保存已经失效的动态页面。</div>
<div>&nbsp;&nbsp;&nbsp; 可以发现Firefox浏览器总是缓存所有页面，不管失效、不失效还是没有声明失效时间。即使缓存中声明了一个网页的实效日期是1970-01- 01 08:00:00，浏览器仍然会发送该文件在缓存中的Last-Modified和ETag字段。如果在服务器端验证通过，返回304状态，浏览器就还会使用此缓存。</div>
<div>&nbsp;&nbsp;&nbsp; <strong>Last-Modified</strong>这个头标是一个响应头标，表示客户端(通常指浏览器)所请求资源在服务器端的最后修改时间，通常情况下客户端在接受这个头标后，在以后对这个资源的请求会附带一个&#8217;If-Modified-Since&#8217;请求头标，而这个头标是想告诉服务器上次客户端所请求资源的最后修改时间，对于一些图像,css,js等静态文件资源，配置好了的apache服务器会理解这些If-Modified-Since请求头标，将头标里的时间和文件的最后修改时间进行比较并作出响应，如果二者相等则发送一个304 Not Modfied来告诉客户端所请求资源并未修改让客户端放心使用缓存中的资源，否则的话会重新发送一个新的资源和新的Last-Modified的头标。但是对于一个动态的PHP脚本，我们即使在脚本加入了header(&#8216;Last Modified: &#8216;.$time)来发送一个Last Modified响应头标，当客户端附带&#8217;If-Modified-Since&#8217;在次请求时apache服务器不会进行处理，这需要我们自己用$_SERVER['HTTP_IF_MODIFIED_SINCE']来获取&#8217;If-Modified-Since&#8217;的值自己来进行判断处理。</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; <strong>Cache-Control</strong>字段中可以声明多些元素，例如no-cache, must-revalidate, max-age=0等。这些元素用来指明页面被缓存最大时限，如何被缓存的，如何被转换到另一个不同的媒介，以及如何被存放在持久媒介中的。但是任何一个 Cache-Control指令都不能保证隐私性或者数据的安全性。&ldquo;private&rdquo;和&ldquo;no-store&rdquo;指令可以为隐私性和安全性方面提供一些帮助，但是他们并不能用于替代身份验证和加密。</p>
<div>&nbsp;&nbsp;&nbsp;&nbsp; Apache的mod_cern_meta模块允许文件级Http响应头部的控制，同时它也可以配置Cache-Control头（或任何其他头）。响应头文件是放在原始目录的子目录中，根据原始文件名所命名的一个文件。具体用法请参阅Apache的官方网站。其中Cache-Control : max-age表示失效日期。如果没有启动mod_cern_meta模块，Apache服务器会把Expires字段中的日期换算成以秒为单位的一个 delta值，赋值给max-age。如果启动mod_cern_meta模块，并且配置了max-age值，Apache会将这个覆盖Expires字段。同时，max-age隐含了Canche-Control: public。这样浏览器接受到的Cache-Control : max-age和Expires值就是一致的。</div>
<div>&nbsp;&nbsp;&nbsp; 如果失效日期Cache-Control : max-ag=0或者是负值，浏览器会在对应的缓存中把Expires设置为1970-01-01 08:00:00。</div>
<div>&nbsp;&nbsp;&nbsp; <strong>ETag</strong>(Entity Tag)和Last-Modified类似，也是WEB服务器和客户端用于确认缓存组件的有效性的一种机制，apache 1.3和2.0的ETag格式是inode-size-timestamp，因此当资源被修改，其ETag也发生改变，ETag相对Last-Modified更精确，Last-Modified只能精确的s级别，但是ETag在多服务器可能造成混乱，所以用还是不用还得看实际情况，其相对应的后续请求头标为If-None-Match。</div>
</div>
</div>
</div>
<hr />
<p><small>© 行骏 for <a href="http://www.movinghorse.cn">行骏-IT Player</a>, 2009. |
<a href="http://www.movinghorse.cn/2009/07/20/analysis-of-web-caching-mechanism/">Permalink</a> |
<a href="http://www.movinghorse.cn/2009/07/20/analysis-of-web-caching-mechanism/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.movinghorse.cn/2009/07/20/analysis-of-web-caching-mechanism/&title=网页缓存机制分析">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.movinghorse.cn/2009/07/20/analysis-of-web-caching-mechanism/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
