<?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>三水清css</title>
	<atom:link href="http://js8.in/tag/css/feed" rel="self" type="application/rss+xml" />
	<link>http://js8.in</link>
	<description>专注前端开发,分享Javascript/CSS/PHP等Web前端开发技巧</description>
	<lastBuildDate>Sat, 04 Feb 2012 07:28:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>IE6下javascript不能隐藏select标签的bug</title>
		<link>http://js8.in/686.html</link>
		<comments>http://js8.in/686.html#comments</comments>
		<pubDate>Sat, 14 May 2011 07:50:57 +0000</pubDate>
		<dc:creator>三水清</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[web前端开发]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.js8.in/?p=686</guid>
		<description><![CDATA[昨天做了一个简单的项目，要求有三级联动的select菜单，可是伤不起的IE6下就出现了不能隐藏select的bug，之前我也介绍过IE6下select层高的问题，可以通过隐藏select或者使用iframe遮挡的方式来解决，今天的bug不同以前，大家如果在用js控制select显示隐藏的时候可能会经常遇到，调试一下午终于找到了解决的方案，特此记录一下<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="png在IE6下透明的几种方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F448.html&from=http%3A%2F%2Fjs8.in%2F686.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/23/8885105.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">png在IE6下透明的几种方法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="IE6中javascript文件开启Gzip出现代码不执行情况" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F902.html&from=http%3A%2F%2Fjs8.in%2F686.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">IE6中javascript文件开启Gzip出现代码不执行情况</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="IE6 PNG图片不透明问题的解决方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F380.html&from=http%3A%2F%2Fjs8.in%2F686.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/01/2770440.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">IE6 PNG图片不透明问题的解决方法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="解决IE6 select z-index无效，遮挡div的bug" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F553.html&from=http%3A%2F%2Fjs8.in%2F686.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10987560.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">解决IE6 select z-index无效，遮挡div的bug</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>昨天做了一个简单的项目，要求有三级联动的select菜单，可是伤不起的IE6下就出现了<strong>不能隐藏select</strong>的bug，之前我也介绍过IE6下select层高的问题，可以通过隐藏select或者<a title="解决IE6 select z-index无效，遮挡div的bug" href="http://js8.in/553.html" target="_blank">使用iframe遮挡</a>的方式来解决，今天的bug不同以前，大家如果在用js控制select显示隐藏的时候可能会经常遇到，调试一下午终于找到了解决的方案，特此记录一下。</p>
<h3>IE6不能隐藏select重现代码</h3>
<p>建立两个关联的select，通过javascript控制第一个select 发生变化后，第二个select根据第一个value重新添加options，如果为空则隐藏第二个select（示例中判断除第一个之外都隐藏），则由第一个select的第三个value切换到第二个value则第二个select就不会隐藏。<br />
具体效果见下面的实例：</p>
<p class="demoview"><a target="_blank" href="//js8.in/mywork/ie6selectbug.html" target="_blank">IE6 select隐藏bug</a></p>
<h3>IE6下不能隐藏select标签解决方案</h3>
<ol>
<li>可以通过先设置select为显示，后设置为none的方式</li>
<li>通过给select添加class来控制显示</li>
</ol>
<p>具体方法，见示例代码源码注释的地方。
<div class="copyright">
<strong>声明：</strong>文章未声明为原创文章，本文链接 <a href="http://js8.in/686.html" title="IE6下javascript不能隐藏select标签的bug">http://js8.in/686.html</a>. 转载请注明转自<a href="http://js8.in" title="前端开发博客"> JS8.IN ™</a></span></span></div>
<h3 class="box-title">随机文章</h3>
<ul class="box_random">
<li><a href="http://js8.in/781.html" title="javascript获取隐藏dom的宽高" rel="bookmark inlinks">javascript获取隐藏dom的宽高</a></li>
<li><a href="http://js8.in/442.html" title="获取滔滔头像图片地址的算法" rel="bookmark inlinks">获取滔滔头像图片地址的算法</a></li>
<li><a href="http://js8.in/270.html" title="病毒清除啦~可是似乎xp中访问博客还是很慢！" rel="bookmark inlinks">病毒清除啦~可是似乎xp中访问博客还是很慢！</a></li>
<li><a href="http://js8.in/23.html" title="园艺学院网站内测！开始，欢迎访问" rel="bookmark inlinks">园艺学院网站内测！开始，欢迎访问</a></li>
<li><a href="http://js8.in/426.html" title="7个JavaScript在IE和Firefox浏览器下的差异写法" rel="bookmark inlinks">7个JavaScript在IE和Firefox浏览器下的差异写法</a></li>
<li><a href="http://js8.in/674.html" title="使用xdebug调试PHP 找出PHP程序的瓶颈" rel="bookmark inlinks">使用xdebug调试PHP 找出PHP程序的瓶颈</a></li>
<li><a href="http://js8.in/4.html" title="哎~都挺穷的！" rel="bookmark inlinks">哎~都挺穷的！</a></li>
<li><a href="http://js8.in/600.html" title="jQuery教程之鼠标事件篇" rel="bookmark inlinks">jQuery教程之鼠标事件篇</a></li>
</ul>
<hr />
<p><small>© 三水清 for <a href="http://js8.in">三水清</a>, 2011. |
<a href="http://js8.in/686.html#comments">4 comments</a> |在微博关注我：<a href="//weibo.com/sanshuiqing" target="_blank" title="关注断桥残雪的新浪微博">@清-三水清</a>
<br/>收藏到：
<a rel="nofollow" href="http://share.renren.com/share/buttonshare.do?link=%posturl%&title=%posttitle%" title="收藏本文到人人网" target="_blank">人人网</a> | <a rel="nofollow" href="http://www.douban.com/recommend/?url=%posturl%&title=%posttitle%" title="收藏本文到豆瓣" target="_blank">豆瓣</a> | <a rel="nofollow" href="http://www.kaixin001.com/repaste/share.php?rtitle=%posttitle%&rurl=%posturl%" title="收藏本文到开心网" target="_blank">开心网</a> | <a rel="nofollow" href="http://shuqian.qq.com/post?title=%posttitle%&%20uri=%posturl%" title="收藏本文到QQ书签" target="_blank">QQ书签</a> | <a rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=%posturl%&title=%posttitle%" title="收藏本文到新浪微博" target="_blank">新浪微博</a> | <a rel="nofollow" href="http://v.t.qq.com/share/share.php?title=%posttitle%&url=%posturl%&site=http://www.kaixin100.info" title="收藏本文到腾讯微博" target="_blank">腾讯微博</a>
<br/>
Post tags: <a href="http://js8.in/tag/css" rel="tag">css</a>, <a href="http://js8.in/tag/ie6" rel="tag">IE6</a>, <a href="http://js8.in/tag/javascript" rel="tag">javascript</a><br/>
</small></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="png在IE6下透明的几种方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F448.html&from=http%3A%2F%2Fjs8.in%2F686.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/23/8885105.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">png在IE6下透明的几种方法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="IE6中javascript文件开启Gzip出现代码不执行情况" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F902.html&from=http%3A%2F%2Fjs8.in%2F686.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">IE6中javascript文件开启Gzip出现代码不执行情况</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="IE6 PNG图片不透明问题的解决方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F380.html&from=http%3A%2F%2Fjs8.in%2F686.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/01/2770440.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">IE6 PNG图片不透明问题的解决方法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="解决IE6 select z-index无效，遮挡div的bug" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F553.html&from=http%3A%2F%2Fjs8.in%2F686.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10987560.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">解决IE6 select z-index无效，遮挡div的bug</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://js8.in/686.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>三种常见jQuery幻灯片（jQuery slider）制作教程</title>
		<link>http://js8.in/668.html</link>
		<comments>http://js8.in/668.html#comments</comments>
		<pubDate>Sat, 22 Jan 2011 07:25:54 +0000</pubDate>
		<dc:creator>三水清</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[网络技术]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.js8.in/?p=668</guid>
		<description><![CDATA[今天的三个jQuery幻灯片其实还是两个，只不过第一种滚动的幻灯片有两种形式：分别是上下滚动和左右滚动。效果和淘宝首页的幻灯片效果相同，自动播放时是一直往一个方向前进。布局方面还算比较简洁，大家可以根据自己的需要添加内容，另外这次的幻灯片加上了文字，其实不光图片可以slider，文字也可以slider一会的。<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="CSS+jQuery实现滑动幻灯片实例详解" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F479.html&from=http%3A%2F%2Fjs8.in%2F668.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10977740.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS+jQuery实现滑动幻灯片实例详解</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery教程之鼠标事件篇" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F600.html&from=http%3A%2F%2Fjs8.in%2F668.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979601.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery教程之鼠标事件篇</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery选择器使用详解" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F416.html&from=http%3A%2F%2Fjs8.in%2F668.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10977318.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery选择器使用详解</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery浏览器判断一个bug，以及修改建议" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F337.html&from=http%3A%2F%2Fjs8.in%2F668.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026214.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery浏览器判断一个bug，以及修改建议</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>好久没正儿八经的写写js代码了，再不写就生疏了，昨天无意中发现cityhouse的首页幻灯片有问题，于是今天就写了三个<strong>幻灯片</strong>实例，如果还不会用<strong>jquery</strong>写幻灯片的可以参考我之前的文章：《<a title="jquery幻灯片教程" href="http://js8.in/479.html">CSS+jQuery实现滑动幻灯片实例详解</a>》以及<a title="jquery幻灯片实例教程" href="http://js8.in/462.html">两个jQuery幻灯片实例</a>。</p>
<p>今天的<a target="_blank" href="http://js8.in/mywork/jq_slider3/" title="三种常见jQuery幻灯片（jQuery slider）实例" >三个jQuery幻灯片</a>其实还是两个，只不过第一种滚动的幻灯片有两种形式：分别是上下滚动和左右滚动。兼容IE6+，FF，chrome等主流浏览器。<br />
效果和淘宝首页的幻灯片效果相同，自动播放时是一直往一个方向前进。<br />
布局方面还算比较简洁，大家可以根据自己的需要添加内容，另外这次的幻灯片加上了文字，其实不光图片可以slider，文字也可以slider一会的。另外加了一点CSS3，就是控制按钮圆角化了（FF3.6+和chrome下有效果）。</p>
<h3>截图</h3>
<div id="attachment_669" class="wp-caption aligncenter" style="width: 310px"><a href="http://js8.in/668.html/snap1-18" rel="attachment wp-att-669"><img src="http://js8.in/wp-content/uploads/2011/01/Snap1-300x202.jpg" alt="三种常见jQuery幻灯片（jQuery slider）实例" title="三种常见jQuery幻灯片（jQuery slider）实例" width="300" height="202" class="size-medium wp-image-669" /></a><p class="wp-caption-text">三种常见jQuery幻灯片（jQuery slider）实例</p></div>
<h3>教程</h3>
<p><span id="more-668"></span><br />
可以研究其中的代码，原来与之前的文章教程类似：《<a title="jquery幻灯片教程" href="http://js8.in/479.html">CSS+jQuery实现滑动幻灯片实例详解</a>》</p>
<h3>实例</h3>
<p class="demoview"><a target="_blank" href="http://js8.in/mywork/jq_slider3/" title="三种常见jQuery幻灯片（jQuery slider）实例" >查看幻灯片演示</a></p>
<div class="copyright">
<strong>声明：</strong>文章未声明为原创文章，本文链接 <a href="http://js8.in/668.html" title="三种常见jQuery幻灯片（jQuery slider）制作教程">http://js8.in/668.html</a>. 转载请注明转自<a href="http://js8.in" title="前端开发博客"> JS8.IN ™</a></span></span></div>
<h3 class="box-title">随机文章</h3>
<ul class="box_random">
<li><a href="http://js8.in/497.html" title="韩峰其实是个好干部" rel="bookmark inlinks">韩峰其实是个好干部</a></li>
<li><a href="http://js8.in/43.html" title="对Zblog的页面分页链接的修改" rel="bookmark inlinks">对Zblog的页面分页链接的修改</a></li>
<li><a href="http://js8.in/20.html" title="手把手图解教你使用PQ魔法师调节硬盘分区大小" rel="bookmark inlinks">手把手图解教你使用PQ魔法师调节硬盘分区大小</a></li>
<li><a href="http://js8.in/567.html" title="一个中国人笑不起来的笑话" rel="bookmark inlinks">一个中国人笑不起来的笑话</a></li>
<li><a href="http://js8.in/272.html" title="普通话考试！~" rel="bookmark inlinks">普通话考试！~</a></li>
<li><a href="http://js8.in/42.html" title="ZBlog表情更新——柏夫版【超酷搞笑】" rel="bookmark inlinks">ZBlog表情更新——柏夫版【超酷搞笑】</a></li>
<li><a href="http://js8.in/692.html" title="新浪微博应用：微博送大礼" rel="bookmark inlinks">新浪微博应用：微博送大礼</a></li>
<li><a href="http://js8.in/336.html" title="博客终于再次开通了" rel="bookmark inlinks">博客终于再次开通了</a></li>
</ul>
<hr />
<p><small>© 三水清 for <a href="http://js8.in">三水清</a>, 2011. |
<a href="http://js8.in/668.html#comments">2 comments</a> |在微博关注我：<a href="//weibo.com/sanshuiqing" target="_blank" title="关注断桥残雪的新浪微博">@清-三水清</a>
<br/>收藏到：
<a rel="nofollow" href="http://share.renren.com/share/buttonshare.do?link=%posturl%&title=%posttitle%" title="收藏本文到人人网" target="_blank">人人网</a> | <a rel="nofollow" href="http://www.douban.com/recommend/?url=%posturl%&title=%posttitle%" title="收藏本文到豆瓣" target="_blank">豆瓣</a> | <a rel="nofollow" href="http://www.kaixin001.com/repaste/share.php?rtitle=%posttitle%&rurl=%posturl%" title="收藏本文到开心网" target="_blank">开心网</a> | <a rel="nofollow" href="http://shuqian.qq.com/post?title=%posttitle%&%20uri=%posturl%" title="收藏本文到QQ书签" target="_blank">QQ书签</a> | <a rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=%posturl%&title=%posttitle%" title="收藏本文到新浪微博" target="_blank">新浪微博</a> | <a rel="nofollow" href="http://v.t.qq.com/share/share.php?title=%posttitle%&url=%posturl%&site=http://www.kaixin100.info" title="收藏本文到腾讯微博" target="_blank">腾讯微博</a>
<br/>
Post tags: <a href="http://js8.in/tag/css" rel="tag">css</a>, <a href="http://js8.in/tag/css3" rel="tag">css3</a>, <a href="http://js8.in/tag/javascript" rel="tag">javascript</a>, <a href="http://js8.in/tag/jquery" rel="tag">jquery</a><br/>
</small></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="CSS+jQuery实现滑动幻灯片实例详解" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F479.html&from=http%3A%2F%2Fjs8.in%2F668.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10977740.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS+jQuery实现滑动幻灯片实例详解</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery教程之鼠标事件篇" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F600.html&from=http%3A%2F%2Fjs8.in%2F668.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979601.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery教程之鼠标事件篇</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery选择器使用详解" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F416.html&from=http%3A%2F%2Fjs8.in%2F668.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10977318.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery选择器使用详解</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery浏览器判断一个bug，以及修改建议" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F337.html&from=http%3A%2F%2Fjs8.in%2F668.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026214.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery浏览器判断一个bug，以及修改建议</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://js8.in/668.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>前端必须熟悉的10个CSS3属性</title>
		<link>http://js8.in/648.html</link>
		<comments>http://js8.in/648.html#comments</comments>
		<pubDate>Thu, 30 Dec 2010 02:59:57 +0000</pubDate>
		<dc:creator>三水清</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[网络技术]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>

		<guid isPermaLink="false">http://www.js8.in/?p=648</guid>
		<description><![CDATA[随着Css3和html5的风靡，越来越多的前端人员开始学习Css3，今天的文章就是来说说前端应该掌握10个Css3属性。上篇博文提到了《前端必须掌握30个CSS3选择器》，但是对于Css3的新属性，你又了解多少呢？虽然大多数的css3属性在很多流行的浏览器中不支持，但是我们鼓励在前端开发中要学会并且运行这些css3属性，因为这是未来的趋势。<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Less—让CSS如此简单" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F477.html&from=http%3A%2F%2Fjs8.in%2F648.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979339.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Less—让CSS如此简单</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS3 Media Queries使用方法详解" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F643.html&from=http%3A%2F%2Fjs8.in%2F648.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026785.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS3 Media Queries使用方法详解</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="前端必须掌握30个CSS3选择器" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F647.html&from=http%3A%2F%2Fjs8.in%2F648.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10980543.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">前端必须掌握30个CSS3选择器</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="悼念地震，网站变灰CSS代码" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F528.html&from=http%3A%2F%2Fjs8.in%2F648.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/08/16/23067609.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">悼念地震，网站变灰CSS代码</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>随着Css3和html5的风靡，越来越多的前端人员开始学习Css3，今天的文章就是来说说前端应该掌握10个Css3属性。  上篇博文提到了《<a title="前端必须掌握30个CSS3选择器" href="http://js8.in/647.html" target="_blank">前端必须掌握30个CSS3选择器</a>》，但是对于Css3的新属性，你又了解多少呢？虽然大多数的css3属性在很多流行的浏览器中不支持，但是我们鼓励在前端开发中要学会并且运行这些css3属性，因为这是未来的趋势。  关键是首先确定你是否对各个浏览器之间的细微的差别有所了解，你能肯定的说IE显示的90度的角就不圆滑嘛？这取决于你的决定。但是要永远记住，网站设计不必看到所有浏览器的不同。在文章的最后，我们将显示一个有趣的最终的案例。</p>
<h3>1、border-radius</h3>
<div id="attachment_649" class="wp-caption aligncenter" style="width: 301px"><a rel="attachment wp-att-649" href="http://js8.in/648.html/attachment/201012220003115125"><img class="size-full wp-image-649" title="border-radius" src="http://js8.in/wp-content/uploads/2010/12/201012220003115125.png" alt="border-radius" width="291" height="160" /></a><p class="wp-caption-text">border-radius</p></div>
<p><strong>border-radius</strong>是一大堆CSS3属性中最受欢迎的一种，border-radius是CSS3中级别最高的一个属性。当设计者害怕一个层在将在不同的浏览器之间以不同的方式显示时，CSS圆角，一个很初级的知识，将引导他们开始学习。  我们为移动浏览器提供一个备用的观看体验的想法都非常好。奇怪的是，当这种方法出现在桌面浏览器上时，他们却又不这么认为。  border-radius是一大堆CSS3属性中最受欢迎的一种，border-radius是CSS3中级别最高的一个属性。当设计者害怕一个层在将在不同的浏览器之间以不同的方式显示时，CSS圆角，一个很初级的知识，将引导他们开始学习。  我们为移动浏览器提供一个备用的观看体验的想法都非常好。奇怪的是，当这种方法出现在桌面浏览器上时，他们却又不这么认为。</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">-webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">4px</span><span style="color: #00AA00;">;</span>
-moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">4px</span><span style="color: #00AA00;">;</span>
border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">4px</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>注意：请在Safari 5 和 IE9浏览器中执行”border-radius”语法。<br />
 <strong>圆</strong><br />
许多读者也许不会意识到我们可以用这个属性来做一个圆。<br />
<span id="more-648"></span></p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">-moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
-webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
 border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span><span style="color: #00AA00;">;</span></pre></div></div>

<div id="attachment_650" class="wp-caption aligncenter" style="width: 122px"><a rel="attachment wp-att-650" href="http://js8.in/648.html/201012220003115125-2"><img class="size-full wp-image-650" title="圆" src="http://js8.in/wp-content/uploads/2010/12/2010122200031151251.png" alt="圆" width="112" height="112" /></a><p class="wp-caption-text">圆</p></div>
<p>如果想再添加点效果，我们可以利用Flexible Box Model（详情在8中）来使得文字在垂直在水平方向都居中。这需要加点代码，但这仅仅是对不同浏览器的补偿。</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> -moz-box<span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> -webkit-box<span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> box<span style="color: #00AA00;">;</span>
-moz-box-orient<span style="color: #00AA00;">:</span> horizontal<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* the default, so not really necessary here */</span>
-webkit-box-orient<span style="color: #00AA00;">:</span> horizontal<span style="color: #00AA00;">;</span>
box-orient<span style="color: #00AA00;">:</span> horizontal<span style="color: #00AA00;">;</span>
-moz-box-pack<span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
-moz-box-align<span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
-webkit-box-pack<span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
-webkit-box-align<span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
box-pack<span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
box-align<span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span></pre></div></div>

<h3>2、 box-shadow</h3>
<div id="attachment_651" class="wp-caption aligncenter" style="width: 264px"><a rel="attachment wp-att-651" href="http://js8.in/648.html/201012220003115125-3"><img class="size-medium wp-image-651" title="box-shadow" src="http://js8.in/wp-content/uploads/2010/12/2010122200031151252-254x300.jpg" alt="box-shadow" width="254" height="300" /></a><p class="wp-caption-text">box-shadow</p></div>
<p>接下来是非常普遍的<strong>box-shadow</strong>，可以使你的元素立即美化，只是记得不要把值设得太离谱。</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">-webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #933;">3px</span> <span style="color: #cc00cc;">#292929</span><span style="color: #00AA00;">;</span>
-moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #933;">3px</span> <span style="color: #cc00cc;">#292929</span><span style="color: #00AA00;">;</span>
box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #933;">3px</span> <span style="color: #cc00cc;">#292929</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>box-shadow的四个参数</p>
<ol>
<li>x-offset x轴偏移</li>
<li>y-offset y轴偏移</li>
<li>blur 模糊值</li>
<li>color of shadow 阴影颜色</li>
</ol>
<p>现在，许多人不知道可以一次运用多个box-shadows，这样做会产生一些有趣的效果。在下图中，我使用蓝色和绿色阴影来放大一下效果。</p>
<div id="attachment_652" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-652" href="http://js8.in/648.html/201012220003115125-4"><img class="size-medium wp-image-652" title="box-shadow" src="http://js8.in/wp-content/uploads/2010/12/2010122200031151253-300x242.jpg" alt="box-shadow" width="300" height="242" /></a><p class="wp-caption-text">box-shadow</p></div>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">-webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #933;">3px</span> <span style="color: #993333;">green</span><span style="color: #00AA00;">,</span> <span style="color: #933;">-1px</span> <span style="color: #933;">-1px</span> <span style="color: #000000; font-weight: bold;">blue</span><span style="color: #00AA00;">;</span>
-moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #933;">3px</span> <span style="color: #993333;">green</span><span style="color: #00AA00;">,</span><span style="color: #933;">-1px</span> <span style="color: #933;">-1px</span> <span style="color: #000000; font-weight: bold;">blue</span><span style="color: #00AA00;">;</span>
box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #933;">3px</span> <span style="color: #993333;">green</span><span style="color: #00AA00;">,</span> <span style="color: #933;">-1px</span> <span style="color: #933;">-1px</span> <span style="color: #000000; font-weight: bold;">blue</span><span style="color: #00AA00;">;</span></pre></div></div>

<p><strong>Clever Shadows </strong></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;box&quot;&gt;
   &lt;img src=&quot;tuts.jpg&quot; alt=&quot;Tuts&quot; /&gt;
&lt;/div&gt;</pre></div></div>

<p><strong>The CSS</strong></p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.box</span><span style="color: #3333ff;">:after </span><span style="color: #00AA00;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">''</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> -<span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* hide shadow behind image */</span>
&nbsp;
   <span style="color: #808080; font-style: italic;">/* The Shadow */</span>
   -webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">15px</span> <span style="color: #933;">20px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.3</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
   -moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">15px</span> <span style="color: #933;">20px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.3</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
   -box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">15px</span> <span style="color: #933;">20px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.3</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>                
&nbsp;
   <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">70</span>%</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">15</span>%</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* one half of the remaining 30% (see width above) */</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">:</span>  <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><a rel="attachment wp-att-653" href="http://js8.in/648.html/201012220003115125-5"><img class="aligncenter size-medium wp-image-653" title="box-shadow" src="http://js8.in/wp-content/uploads/2010/12/2010122200031151254-300x187.png" alt="box-shadow" width="300" height="187" /></a></p>
<h3>3、 text-shadow</h3>
<div id="attachment_654" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-654" href="http://js8.in/648.html/201012220003115125-6"><img class="size-medium wp-image-654" title="text-shadow" src="http://js8.in/wp-content/uploads/2010/12/2010122200031151255-300x123.jpg" alt="text-shadow" width="300" height="123" /></a><p class="wp-caption-text">text-shadow</p></div>
<p><strong>text-shadow</strong>是我们可以省略前缀的几个CSS属性之一，类似的还有box-shadow，它必须应用于文本，并它们有相同的四个参数：</p>
<ol>
<li>x-offset 水平位移</li>
<li>y-offest 垂直位移</li>
<li>blur 模糊值</li>
<li>color of shadow 阴影颜色</li>
</ol>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"> h1 <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">1px</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#292929</span><span style="color: #00AA00;">;</span>
 <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><strong>Text-Outline</strong> 和box-shadow一样，它可以设置多个阴影通过逗号分隔符。例如，我们创建文本框的轮廓，当webkit不支持stroke效果，我们可以使用下面的代码让更多的浏览器支持（虽然不是很美观）。</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">body <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">white</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
h1 <span style="color: #00AA00;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">1px</span> <span style="color: #cc66cc;">0</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">-1px</span> <span style="color: #cc66cc;">0</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">,</span> <span style="color: #933;">1px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">,</span> <span style="color: #933;">-1px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<div id="attachment_655" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-655" href="http://js8.in/648.html/201012220003115125-7"><img class="size-medium wp-image-655" title="Text-Outline" src="http://js8.in/wp-content/uploads/2010/12/2010122200031151256-300x89.jpg" alt="Text-Outline" width="300" height="89" /></a><p class="wp-caption-text">Text-Outline</p></div>
<h3>4、 Text-Stroke</h3>
<div id="attachment_656" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-656" href="http://js8.in/648.html/201012220003115125-8"><img class="size-medium wp-image-656" title="Text-Stroke" src="http://js8.in/wp-content/uploads/2010/12/2010122200031151257-300x103.jpg" alt="Text-Stroke" width="300" height="103" /></a><p class="wp-caption-text">Text-Stroke</p></div>
<p>使用这个方法时要注意了，只有webkit（Safari， Chrome， iPhone）在最后的几年内还支持这个属性。其实，虽然我可能是错的，<strong>text-stroke</strong>还不属于CSS3范畴的一部分。在这种情况下，使用白 色字体时，firefox会显示一个空白页面。要解决此问题，你即可以使用Javascript，也可以通过使用一种不同于背景颜色的文字颜色。</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">h1 <span style="color: #00AA00;">&#123;</span>
   -webkit-text-stroke<span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><strong>Feature Detection</strong> 我们如何为firefox提供一组可用的样式，和为另外的一组Safari或Chrome？解决办法就是多做测试。  通过feature detection，我们可以利用JavaScript来测试某属性是否可用，如果不行，我可就要采用备用的。  再回到text-stroke的问题上，为不支持此属性的浏览器设定一个备用黑色（目前的除webkit外）。</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> h1 <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'h1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'webkitTextStroke'</span> <span style="color: #000066; font-weight: bold;">in</span> h1.<span style="color: #660066;">style</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #003366; font-weight: bold;">var</span> heading <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'h1'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
   heading.<span style="color: #660066;">style</span>.<span style="color: #660066;">color</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'black'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>首先我们设定一个h1元素，然后执行，通过样式属性以确定-webkit-text-stroke是否支持此元素。如果不支持，我们会把标题由白色设置成黑色。</p>
<h3>5、 Multiple Backgrounds</h3>
<div id="attachment_657" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-657" href="http://js8.in/648.html/201012220003115125-9"><img class="size-medium wp-image-657" title="Multiple Backgrounds" src="http://js8.in/wp-content/uploads/2010/12/2010122200031151258-300x192.jpg" alt="Multiple Backgrounds" width="300" height="192" /></a><p class="wp-caption-text">Multiple Backgrounds</p></div>
<p><strong>Background</strong>属性在CSS3样式中已经彻底改革，开始支持多背景图片。  举个简单的例子，如果没和合适的图像，我们将使用两个教程的图像作为我们的背景，当然在程序中你可能会用纹理，也许是渐变作为图像。</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.box</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">image/path.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">,</span>
 <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">image2/path.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>以上，通过逗号分隔符，插入了两张背景图像，第一个的定位是（0，0），第二个的定位是（100%，0）。  要确定你对不支持的浏览器使用了备用图片，否则，它将跳此属性，使背景图像留空。  <strong>对旧浏览器的补偿</strong> 要添加一张单独的图像给老浏览器用，像IE7。要定义两遍background，一遍是为老浏览器，另一遍是重写。或者你可以再次查看下Modernizr。</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.box</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #808080; font-style: italic;">/* fallback */</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">image/path.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* modern browsers */</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">image/path.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">,</span>
 <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">image2/path.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h3>6、 background-size</h3>
<p>目前我们已经可以使用这种比较灵活的方式去重定义背景图像的大小。</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">path/to/image.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
background-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span> <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>上面的代码使得背景图像已经占据了整个可用空间。但是，如果我们使用一个特殊的图片去占据body元素的整个空间而无论窗口有多宽，那又怎么做？</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">body<span style="color: #00AA00;">,</span> html <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
body <span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">path/to/image.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
 background-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span> <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>对，就是这么做，分别定义background-size的x，y参数。 最新版本的Chrome 和 Safari支持此属性，但我们还是要用旧的方法支持旧的浏览器。</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">body <span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">path/to/image.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
 -moz-background-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span> <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span><span style="color: #00AA00;">;</span>
 -o-background-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span> <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span><span style="color: #00AA00;">;</span>
 -webkit-background-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span> <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span><span style="color: #00AA00;">;</span>
 background-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span> <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h3>7、 text-overflow</h3>
<p>浏览器最初开发文本溢出属性可以设定两个值：clip ellipsis 此属性支持切断容器中的文本，而且也给出了一个省略号的特性。</p>
<div id="attachment_658" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-658" href="http://js8.in/648.html/201012220003115125-10"><img class="size-medium wp-image-658" title="text-overflow" src="http://js8.in/wp-content/uploads/2010/12/2010122200031151259-300x221.png" alt="text-overflow" width="300" height="221" /></a><p class="wp-caption-text">text-overflow</p></div>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.box</span> <span style="color: #00AA00;">&#123;</span>
   -o-text-<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> ellipsis<span style="color: #00AA00;">;</span>
   text-<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span>ellipsis<span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">white-space</span><span style="color: #00AA00;">:</span><span style="color: #993333;">nowrap</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">400px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>或许你会考虑当鼠标经过时显示全部的文本内容。</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#box</span><span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</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: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#e3e3e3</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#666</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>有点奇怪，这看起来并不像是重置text-overflow属性或是停用它，使之生效，在on:hover中我们可以使得white-space的normal属性。现在正常了。  知道吗？您还可以指定自己的字符串，应使用省略号的位置。这样做来修饰要显示的文本字符串。</p>
<h3>8、 Flexible Box Model</h3>
<p>Flexible Box Model将最终使我们远离类似float的困扰。虽然是要给你的头部换一个新的属性，但一旦你这么做了，将终身受益。 做个演示，创建简单的两列布局。</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;container&quot;&gt;
 &lt;div id=&quot;main&quot;&gt; Main content here &lt;/div&gt;
 &lt;aside&gt; Aside content here &lt;/aside&gt;
&lt;/div&gt;</pre></div></div>

<p>首先我们要设定一个容器，然后指定它的宽和高，即便是没有实质性的内容在里面。</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#container</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">960px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">500px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* just for demo */</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#e3e3e3</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> -moz-box<span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> -webkit-box<span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> box<span style="color: #00AA00;">;</span></pre></div></div>

<p>接下来分别定义#main和aside的背景色</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#main</span> <span style="color: #00AA00;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">yellow</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>   
&nbsp;
aside <span style="color: #00AA00;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>到目前为了还没有看出什么效果来。</p>
<dl>
<dt><a rel="attachment wp-att-659" href="http://js8.in/648.html/201012220003115125-11"><img style="padding: 0px; margin: 0px; border: 0px none initial;" title="Flexible Box Model" src="http://js8.in/wp-content/uploads/2010/12/20101222000311512510-300x176.png" alt="Flexible Box Model" width="300" height="176" /></a></dt>
<dd style="font-size: 11px; line-height: 17px; padding-top: 0px; padding-right: 4px; padding-bottom: 5px; padding-left: 4px; margin: 0px;"> </dd>
</dl>
<p>值得一提的是，虽然我们设置了display:box模型，它的子元素会占据整个垂直空间。这就是它的默认box-align属性stretch。  看看有什么效果产生，当我们设置了#main的宽度后。</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#main</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">yellow</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">800px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<div id="attachment_660" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-660" href="http://js8.in/648.html/201012220003115125-12"><img class="size-medium wp-image-660" title="Flexible Box Model" src="http://js8.in/wp-content/uploads/2010/12/20101222000311512511-300x159.png" alt="Flexible Box Model" width="300" height="159" /></a><p class="wp-caption-text">Flexible Box Model</p></div>
<p>但是我们仍有个疑问，为什么aside不占据剩余的全部空间呢？我们可以用新属性box-flex来试下。  box-flex 使得元素占据整个空间。</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">aside <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* cause is HTML5 element */</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>
&nbsp;
   <span style="color: #808080; font-style: italic;">/* take up all available space */</span>
    -moz-box-flex<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
    -webkit-box-flex<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
    box-flex<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
 <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>使用这个属性后，不管#main有多宽，aside都将占据整个可用的空间。同时你也不必担心诸如float等产生的问题，像使得元素被排挤到下一行。</p>
<div id="attachment_661" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-661" href="http://js8.in/648.html/201012220003115125-13"><img class="size-medium wp-image-661" title="Flexible Box Model" src="http://js8.in/wp-content/uploads/2010/12/20101222000311512512-300x158.png" alt="Flexible Box Model" width="300" height="158" /></a><p class="wp-caption-text">Flexible Box Model</p></div>
<p>我只是在这儿肤浅的说一下，请参阅保罗爱尔兰优秀文章的详细信息。然而，使用此方法的时候也应注意一下兼容问题，例如老的浏览器应该先测试下，并且提供必要的备注。</p>
<h3>9、 Resize</h3>
<p>只有Firefox 4和Safari 3支持此属性。Resize是CSS3 UI模型中的一部分，可用于重定义textarea的大小。</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;textarea name=&quot;elem&quot; id=&quot;elem&quot; rows=&quot;5&quot; cols=&quot;50&quot;&gt;&lt;/textarea&gt;</pre></div></div>

<p>默认情况下webkit浏览器和Firefox 4支持水平和垂直方向上的重定义。</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">textarea <span style="color: #00AA00;">&#123;</span>
   -moz-resize<span style="color: #00AA00;">:</span> vertical<span style="color: #00AA00;">;</span>
   -webkit-resize<span style="color: #00AA00;">:</span> vertical<span style="color: #00AA00;">;</span>
   resize<span style="color: #00AA00;">:</span> vertical<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>可能的值：</p>
<ol>
<li>both： 重定义水平和垂直方向</li>
<li>horizontal： 水平调整大小限制</li>
<li>vertical： 垂直调整大小限制</li>
<li>none： 不支持重定义</li>
</ol>
<div id="attachment_662" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-662" href="http://js8.in/648.html/201012220003115125-14"><img class="size-medium wp-image-662" title="Resize" src="http://js8.in/wp-content/uploads/2010/12/20101222000311512513-300x106.png" alt="Resize" width="300" height="106" /></a><p class="wp-caption-text">Resize</p></div>
<h3>10、 Transition</h3>
<p>也许CSS3最令人兴奋的增补，就是在没有 JavaScript 的元素的情况下产生动画。  好像IE9还不支持此功能，但这并不代表你不能使用这个功能，关键是在于提高技能。  现在模仿一个效果，当鼠标滑过右侧链接时，文本向右滑动。<br />
<strong>The HTML</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;ul&gt;
   &lt;li&gt;
      &lt;a href=&quot;#&quot;&gt; Hover Over Me &lt;/a&gt;
   &lt;/li&gt;
   &lt;li&gt;
      &lt;a href=&quot;#&quot;&gt; Hover Over Me &lt;/a&gt;
   &lt;/li&gt;
   &lt;li&gt;
      &lt;a href=&quot;#&quot;&gt; Hover Over Me &lt;/a&gt;
   &lt;/li&gt;
   &lt;li&gt;
      &lt;a href=&quot;#&quot;&gt; Hover Over Me &lt;/a&gt;
   &lt;/li&gt;
&lt;/ul&gt;</pre></div></div>

<p><strong>The CSS</strong></p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">ul a <span style="color: #00AA00;">&#123;</span>
    -webkit-transition<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">padding</span> .4s<span style="color: #00AA00;">;</span>
    -moz-transition<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">padding</span> .4s<span style="color: #00AA00;">;</span>
    -o-transition<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">padding</span> .4s<span style="color: #00AA00;">;</span>
    transition<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">padding</span> .4s<span style="color: #00AA00;">;</span>
 <span style="color: #00AA00;">&#125;</span>
&nbsp;
 a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>
 <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>transition 有三个参数：</p>
<ol>
<li>The property to transition. （Set this value to all if needed） 转换属性。（设置此值为所有如有需要）</li>
<li>The duration 持续时间</li>
<li>The easing type 缓动类型</li>
</ol>
<p>为什么我们不将transition直接应用到hover上呢？是因为我们只是在mouseover时生效，当mouseout时元素将立即返回到其最初的状态。 因为我们对效果做了调整，所有对旧的浏览器不会产生任何影响。 接下来是通过文章所学，我们来建立的一个简洁的效果。大家可以通过查看源码来学习来。具体如何创建我就不翻译了。</p>
<div id="attachment_663" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-663" href="http://js8.in/648.html/201012220003115125-15"><img class="size-medium wp-image-663" title="实例" src="http://js8.in/wp-content/uploads/2010/12/20101222000311512514-300x249.png" alt="实例" width="300" height="249" /></a><p class="wp-caption-text">实例</p></div>
<p>原文地址：<a target="_blank" href="http://net.tutsplus.com/tutorials/html-css-techniques/10-css3-properties-you-need-to-be-familiar-with/" target="_blank">10 CSS3 Properties you Need to be Familiar with</a>
<div class="copyright">
<strong>声明：</strong>文章未声明为原创文章，本文链接 <a href="http://js8.in/648.html" title="前端必须熟悉的10个CSS3属性">http://js8.in/648.html</a>. 转载请注明转自<a href="http://js8.in" title="前端开发博客"> JS8.IN ™</a></span></span></div>
<h3 class="box-title">随机文章</h3>
<ul class="box_random">
<li><a href="http://js8.in/34.html" title="留言板美化结束" rel="bookmark inlinks">留言板美化结束</a></li>
<li><a href="http://js8.in/598.html" title="Ubuntu安装NVidia驱动" rel="bookmark inlinks">Ubuntu安装NVidia驱动</a></li>
<li><a href="http://js8.in/636.html" title="俺的Feed地址又换了！" rel="bookmark inlinks">俺的Feed地址又换了！</a></li>
<li><a href="http://js8.in/490.html" title="使用CSS设置文字反选的背景颜色" rel="bookmark inlinks">使用CSS设置文字反选的背景颜色</a></li>
<li><a href="http://js8.in/750.html" title="javascript入门到高级PPT" rel="bookmark inlinks">javascript入门到高级PPT</a></li>
<li><a href="http://js8.in/374.html" title="发布WordPress来访者天气预报插件" rel="bookmark inlinks">发布WordPress来访者天气预报插件</a></li>
<li><a href="http://js8.in/561.html" title="推荐一款支持win7的超酷3D水纹屏保-Watery Desktop" rel="bookmark inlinks">推荐一款支持win7的超酷3D水纹屏保-Watery Desktop</a></li>
<li><a href="http://js8.in/664.html" title="iframe自适用高度代码" rel="bookmark inlinks">iframe自适用高度代码</a></li>
</ul>
<hr />
<p><small>© 三水清 for <a href="http://js8.in">三水清</a>, 2010. |
<a href="http://js8.in/648.html#comments">6 comments</a> |在微博关注我：<a href="//weibo.com/sanshuiqing" target="_blank" title="关注断桥残雪的新浪微博">@清-三水清</a>
<br/>收藏到：
<a rel="nofollow" href="http://share.renren.com/share/buttonshare.do?link=%posturl%&title=%posttitle%" title="收藏本文到人人网" target="_blank">人人网</a> | <a rel="nofollow" href="http://www.douban.com/recommend/?url=%posturl%&title=%posttitle%" title="收藏本文到豆瓣" target="_blank">豆瓣</a> | <a rel="nofollow" href="http://www.kaixin001.com/repaste/share.php?rtitle=%posttitle%&rurl=%posturl%" title="收藏本文到开心网" target="_blank">开心网</a> | <a rel="nofollow" href="http://shuqian.qq.com/post?title=%posttitle%&%20uri=%posturl%" title="收藏本文到QQ书签" target="_blank">QQ书签</a> | <a rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=%posturl%&title=%posttitle%" title="收藏本文到新浪微博" target="_blank">新浪微博</a> | <a rel="nofollow" href="http://v.t.qq.com/share/share.php?title=%posttitle%&url=%posturl%&site=http://www.kaixin100.info" title="收藏本文到腾讯微博" target="_blank">腾讯微博</a>
<br/>
Post tags: <a href="http://js8.in/tag/css" rel="tag">css</a>, <a href="http://js8.in/tag/css3" rel="tag">css3</a><br/>
</small></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Less—让CSS如此简单" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F477.html&from=http%3A%2F%2Fjs8.in%2F648.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979339.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Less—让CSS如此简单</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS3 Media Queries使用方法详解" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F643.html&from=http%3A%2F%2Fjs8.in%2F648.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026785.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS3 Media Queries使用方法详解</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="前端必须掌握30个CSS3选择器" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F647.html&from=http%3A%2F%2Fjs8.in%2F648.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10980543.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">前端必须掌握30个CSS3选择器</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="悼念地震，网站变灰CSS代码" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F528.html&from=http%3A%2F%2Fjs8.in%2F648.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/08/16/23067609.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">悼念地震，网站变灰CSS代码</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://js8.in/648.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>前端必须掌握30个CSS3选择器</title>
		<link>http://js8.in/647.html</link>
		<comments>http://js8.in/647.html#comments</comments>
		<pubDate>Wed, 29 Dec 2010 05:57:58 +0000</pubDate>
		<dc:creator>三水清</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[网络技术]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>

		<guid isPermaLink="false">http://www.js8.in/?p=647</guid>
		<description><![CDATA[也许你已经学会了CSS的三个简单常用的选择器：#ID，.class，标签选择器，可是这些就足够了吗？随着CSS3的到来，作为前端开发者需要掌握下面三十个基本的选择器，这样才可以在平时开发中得心用手。

本文中将综合前端开发中常用的30个CSS3选择器，并且附带了浏览器的支持情况，希望对大家有所帮助。<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="前端必须熟悉的10个CSS3属性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F648.html&from=http%3A%2F%2Fjs8.in%2F647.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/11013672.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">前端必须熟悉的10个CSS3属性</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS3 Media Queries使用方法详解" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F643.html&from=http%3A%2F%2Fjs8.in%2F647.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026785.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS3 Media Queries使用方法详解</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="引入CSS 的两种方式：link和@import的区别" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F554.html&from=http%3A%2F%2Fjs8.in%2F647.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026361.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">引入CSS 的两种方式：link和@import的区别</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS 3.0 参考手册 (中文版)下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F343.html&from=http%3A%2F%2Fjs8.in%2F647.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197221.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS 3.0 参考手册 (中文版)下载</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>也许你已经学会了CSS的三个简单常用的选择器：#ID，.class，标签选择器，可是这些就足够了吗？随着<strong>CSS3</strong>的到来，作为前端开发者需要掌握下面三十个基本的选择器，这样才可以在平时开发中得心用手。</p>
<p>本文中将综合前端开发中常用的30个<strong>CSS3选择器</strong>，并且附带了浏览器的支持情况，希望对大家有所帮助。</p>
<h3>1、*：通用元素选择器</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span>  
 <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>  
 <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>*选择器是选择页面上的全部元素，上面的代码作用是把全部元素的margin和padding设为0，最基本的<a href="http://js8.in/365.html" target="_blank" title="清除默认CSS样式注意事项">清除默认CSS样式</a>方法</p>
<p>*选择器也可以应用到子选择器中，例如下面的代码：</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#container</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span>  
 <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>这样ID为container 的所有子标签元素都被选中了，并且设置了border。</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/star.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE6+</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>#ID：ID选择器</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#container</span> <span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">960px</span><span style="color: #00AA00;">;</span>  
   <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>ID选择器是CSS中效率最高的选择器，使用的时候要保证ID的唯一性。</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/id.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE6+</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>.class:类选择器</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.error</span> <span style="color: #00AA00;">&#123;</span>  
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>类选择器效率低于ID选择器，一个页面可以有多个class，并且class可以放在不同的标签中使用。</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/class.html" target="_blank">查看演示</a></p>
<p><span id="more-647"></span></p>
<h5>兼容性</h5>
<ol>
<li>IE6+</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X Y：标签组合选择器</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">li a <span style="color: #00AA00;">&#123;</span>  
  <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>标签组合选择器也是常用的选择器。</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/descend.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE6+</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X：标签选择器</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">a <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>  
ul <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>如果你只是想要页面中的某个标签样式改变，可以选择使用标签选择器。</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/tagName.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE6+</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X:visited and X:link </h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #3333ff;">:link </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>  
a<span style="color: #3333ff;">:visted </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">purple</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>伪类选择器，最常用的为A标签</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/links.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE7+</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X + Y：毗邻元素选择器</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">ul <span style="color: #00AA00;">+</span> p <span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>毗邻元素选择器，匹配的是所有紧随X元素之后的同级元素Y</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/adjacent.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE7+</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X > Y：子元素选择器</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">div<span style="color: #cc00cc;">#container</span> <span style="color: #00AA00;">&gt;</span> ul <span style="color: #00AA00;">&#123;</span>  
  <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>匹配#container下的所有子元素。<br />
关于<code>X>Y</code>和<code>X Y</code>的区别请看下面的html实例：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;container&quot;&gt;  
   &lt;ul&gt;  
      &lt;li&gt; List Item  
        &lt;ul&gt;  
           &lt;li&gt; Child &lt;/li&gt;  
        &lt;/ul&gt;  
      &lt;/li&gt;  
      &lt;li&gt; List Item &lt;/li&gt;  
      &lt;li&gt; List Item &lt;/li&gt;  
      &lt;li&gt; List Item &lt;/li&gt;  
   &lt;/ul&gt;  
&lt;/div&gt;</pre></div></div>

<p>选择器<code>#container > ul</code>只会匹配到第一个UL，也就是#container的子元素UL，而不是li里面的ul，但是<code>div ul</code>则可以匹配到所有DIV里面的ul。</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/childcombinator.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE7+</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X ~ Y：</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">ul ~ p <span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>匹配任何在X元素之后的同级P元素。也就是选择了UL之后的同级所有的元素。</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/generalcombinator.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE7+</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X[title]：属性选择器</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #00AA00;">&#91;</span>title<span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">green</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>匹配具有某属性的标签，例如实例中是匹配具有title属性的a标签。</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/attributes.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE7+</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X[href="foo"]</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #00AA00;">&#91;</span>href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;http://js8.in&quot;</span><span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>  
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#1f6053</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* nettuts green */</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>也属于属性选择器，匹配属性中为某个值的标签。例如实例中匹配的为<code>href="http://js8.in"</code>的a标签，而其他链接的a标签不选择。</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/attributes2.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE7+</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X[href*="nettuts"]</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #00AA00;">&#91;</span>href<span style="color: #00AA00;">*=</span><span style="color: #ff0000;">&quot;tuts&quot;</span><span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>  
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#1f6053</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* nettuts green */</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>属于属性选择器，匹配href中所有含有tuts的标签。正则匹配</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/attributes3.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE7+</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X[href^="http"]</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #00AA00;">&#91;</span>href<span style="color: #00AA00;">^=</span><span style="color: #ff0000;">&quot;http&quot;</span><span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">path/to/external/icon.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>  
   <span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>与上面的属相选择标签类似，但是匹配的以http开头的A标签，正则匹配</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/attributes4.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE7+</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X[href$=".jpg"]</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #00AA00;">&#91;</span>href$<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;.jpg&quot;</span><span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>匹配属性中以.jpg结尾的标签，正则匹配，也是属性选择器的一种</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/attributes5.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE7+</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X[data-*="foo"]</h3>
<p>如果你要匹配所有的图片链接，你可以通过下面的CSS来实现：</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #00AA00;">&#91;</span>href$<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;.jpg&quot;</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">,</span>  
a<span style="color: #00AA00;">&#91;</span>href$<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;.jpeg&quot;</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">,</span>  
a<span style="color: #00AA00;">&#91;</span>href$<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;.png&quot;</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">,</span>  
a<span style="color: #00AA00;">&#91;</span>href$<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;.gif&quot;</span><span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>但是如果我们给a标签添加一个data-filetype属性，我们就可以使用下面的CSS来快速的选择我们需要匹配的标签了。</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;path/to/image.jpg&quot; data-filetype=&quot;image&quot;&gt; Image Link &lt;/a&gt;  
&lt;/html&gt;
&lt;pre lang=&quot;css&quot;&gt;a[data-filetype=&quot;image&quot;] {  
   color: red;  
}</pre></div></div>

<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/attributes6.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE7+</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X[foo~="bar"]</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #00AA00;">&#91;</span>data-info~<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;external&quot;</span><span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span>  
&nbsp;
a<span style="color: #00AA00;">&#91;</span>data-info~<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;image&quot;</span><span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>匹配属性中具有多个空格分隔的值、其中一个值等于“bar”的X元素，例如下面的例子：</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/attributes7.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE7+</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X:checked</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">input<span style="color: #00AA00;">&#91;</span>type<span style="color: #00AA00;">=</span>radio<span style="color: #00AA00;">&#93;</span><span style="color: #3333ff;">:checked </span><span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>这个选择器主要用于checkbox，选择checkbox为当前选中的那个标签。</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/checked.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE9</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X:after</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.clearfix</span><span style="color: #3333ff;">:after </span><span style="color: #00AA00;">&#123;</span>  
    <span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #00AA00;">;</span>  
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>  
    <span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">both</span><span style="color: #00AA00;">;</span>  
    <span style="color: #000000; font-weight: bold;">visibility</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>  
    <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>  
    <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>  
    <span style="color: #00AA00;">&#125;</span>  
&nbsp;
<span style="color: #6666ff;">.clearfix</span> <span style="color: #00AA00;">&#123;</span>  
   <span style="color: #00AA00;">*</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>  
   _height<span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">1</span>%</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><code>before</code> 和<code>after</code>是在选择的标签之前或者之后插入内容，一般用于清除浮动，但是对于IE6、IE7是不可用的。</p>
<h5>兼容性</h5>
<ol>
<li>IE8+</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X:hover</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">div<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>  
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#e3e3e3</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>最常用的就是A标签了，但是在IE6浏览器下除了A标签之外，其他标签<code>div:hover</code>不匹配。</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/generalcombinator.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE6+（IE6只可以使用在A标签中）</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X:not(selector)</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #00AA00;">*:</span>not<span style="color: #00AA00;">&#40;</span>p<span style="color: #00AA00;">&#41;</span> <span style="color: #00AA00;">&#123;</span>  
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">green</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>选择除了（）中选择器之外的标签元素。</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/not.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE9</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X::pseudoElement</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">p<span style="color: #00AA00;">:</span><span style="color: #3333ff;">:first-line </span><span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>  
   <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.2em</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span>  
p<span style="color: #00AA00;">:</span><span style="color: #3333ff;">:first-letter </span><span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>  
   <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2em</span><span style="color: #00AA00;">;</span>  
   <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>  
   <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">cursive</span><span style="color: #00AA00;">;</span>  
   <span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>分别用于匹配元素的第一行和第一个字母。看实例：</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/pseudoElements.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE6+</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X:nth-child(n)</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">li<span style="color: #3333ff;">:nth-</span>child<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #00AA00;">&#41;</span> <span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>匹配X元素中从头数第几个标签，例如上面的代码是匹配的是第三个li标签。</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/nth.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE9</li>
<li>Firefox 3.5+</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X:nth-last-child(n)</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">li<span style="color: #3333ff;">:nth-last-</span>child<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #00AA00;">&#41;</span> <span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>与上一个选择器相反，这个选择器是倒序匹配第几个标签，上面的代码的意思是匹配倒数第二个li标签</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/nthLast.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE9</li>
<li>Firefox 3.5+</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X:nth-of-type(n)</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">ul<span style="color: #3333ff;">:nth-of-</span>type<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #00AA00;">&#41;</span> <span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>与<code>:nth-child()</code>作用类似，但是仅匹配使用同种标签的元素</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/nthOfType.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE9</li>
<li>Firefox 3.5+</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X:nth-last-of-type(n)</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">ul<span style="color: #3333ff;">:nth-last-of-</span>type<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #00AA00;">&#41;</span> <span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>与<code>:nth-last-child() </code>作用类似，但是仅匹配使用同种标签的元素</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/generalcombinator.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE9</li>
<li>Firefox 3.5+</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X:first-child</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">ul li<span style="color: #3333ff;">:first-child </span><span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>匹配其父元素的第n个子元素，第一个编号为1</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/firstChild.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE7+</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X:last-child</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">ul <span style="color: #00AA00;">&gt;</span> li<span style="color: #3333ff;">:last-child </span><span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">green</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>匹配其父元素的倒数第n个子元素，第一个编号为1</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/firstChild.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE9</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X:only-child</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">div p<span style="color: #3333ff;">:only-child </span><span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>匹配父元素下仅有的一个子元素，等同于:first-child:last-child或 :nth-child(1):nth-last-child(1)</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/onlyChild.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE9</li>
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X:only-of-type</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">li<span style="color: #3333ff;">:only-of-type </span><span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>匹配父元素下使用同种标签的唯一一个子元素，等同于:first-of-type:last-of-type或 :nth-of-type(1):nth-last-of-type(1)</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/onlyOfType.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE9</li>
<li>Firefox 3.5+</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<h3>X:first-of-type</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">li<span style="color: #3333ff;">:only-of-type </span><span style="color: #00AA00;">&#123;</span>  
   <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>匹配父元素下使用同种标签的第一个子元素，等同于:nth-of-type(1)</p>
<p class="demoview"><a target="_blank" href="http://d2o0t5hpnwv4c1.cloudfront.net/840_cssSelectors/selectors/firstOfType.html" target="_blank">查看演示</a></p>
<h5>兼容性</h5>
<ol>
<li>IE9</li>
<li>Firefox 3.5+</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
</ol>
<p>原文出处：http://net.tutsplus.com/tutorials/html-css-techniques/the-30-css-selectors-you-must-memorize/<br />
PS：也不算是翻译，只是根据作者整理的然后融入了我自己的理解，希望大家斧正。
<div class="copyright">
<strong>声明：</strong>文章未声明为原创文章，本文链接 <a href="http://js8.in/647.html" title="前端必须掌握30个CSS3选择器">http://js8.in/647.html</a>. 转载请注明转自<a href="http://js8.in" title="前端开发博客"> JS8.IN ™</a></span></span></div>
<h3 class="box-title">随机文章</h3>
<ul class="box_random">
<li><a href="http://js8.in/300.html" title="公司的DBA说了一些SQL数据库的箴言" rel="bookmark inlinks">公司的DBA说了一些SQL数据库的箴言</a></li>
<li><a href="http://js8.in/238.html" title="真正的jQuery的radio与checkbox取值" rel="bookmark inlinks">真正的jQuery的radio与checkbox取值</a></li>
<li><a href="http://js8.in/634.html" title="Sina App Engine开发实例：天气预报的定时短信（二）" rel="bookmark inlinks">Sina App Engine开发实例：天气预报的定时短信（二）</a></li>
<li><a href="http://js8.in/330.html" title="光良,第一次—珍喜欢" rel="bookmark inlinks">光良,第一次—珍喜欢</a></li>
<li><a href="http://js8.in/607.html" title="提高Firefox的innerHTML()的性能" rel="bookmark inlinks">提高Firefox的innerHTML()的性能</a></li>
<li><a href="http://js8.in/469.html" title="jQuery 1.4.1 中文参考文档下载" rel="bookmark inlinks">jQuery 1.4.1 中文参考文档下载</a></li>
<li><a href="http://js8.in/39.html" title="08.11.17" rel="bookmark inlinks">08.11.17</a></li>
<li><a href="http://js8.in/711.html" title="host配置：设置电脑DNS解析文件host" rel="bookmark inlinks">host配置：设置电脑DNS解析文件host</a></li>
</ul>
<hr />
<p><small>© 三水清 for <a href="http://js8.in">三水清</a>, 2010. |
<a href="http://js8.in/647.html#comments">No comment</a> |在微博关注我：<a href="//weibo.com/sanshuiqing" target="_blank" title="关注断桥残雪的新浪微博">@清-三水清</a>
<br/>收藏到：
<a rel="nofollow" href="http://share.renren.com/share/buttonshare.do?link=%posturl%&title=%posttitle%" title="收藏本文到人人网" target="_blank">人人网</a> | <a rel="nofollow" href="http://www.douban.com/recommend/?url=%posturl%&title=%posttitle%" title="收藏本文到豆瓣" target="_blank">豆瓣</a> | <a rel="nofollow" href="http://www.kaixin001.com/repaste/share.php?rtitle=%posttitle%&rurl=%posturl%" title="收藏本文到开心网" target="_blank">开心网</a> | <a rel="nofollow" href="http://shuqian.qq.com/post?title=%posttitle%&%20uri=%posturl%" title="收藏本文到QQ书签" target="_blank">QQ书签</a> | <a rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=%posturl%&title=%posttitle%" title="收藏本文到新浪微博" target="_blank">新浪微博</a> | <a rel="nofollow" href="http://v.t.qq.com/share/share.php?title=%posttitle%&url=%posturl%&site=http://www.kaixin100.info" title="收藏本文到腾讯微博" target="_blank">腾讯微博</a>
<br/>
Post tags: <a href="http://js8.in/tag/css" rel="tag">css</a>, <a href="http://js8.in/tag/css3" rel="tag">css3</a><br/>
</small></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="前端必须熟悉的10个CSS3属性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F648.html&from=http%3A%2F%2Fjs8.in%2F647.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/11013672.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">前端必须熟悉的10个CSS3属性</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS3 Media Queries使用方法详解" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F643.html&from=http%3A%2F%2Fjs8.in%2F647.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026785.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS3 Media Queries使用方法详解</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="引入CSS 的两种方式：link和@import的区别" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F554.html&from=http%3A%2F%2Fjs8.in%2F647.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026361.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">引入CSS 的两种方式：link和@import的区别</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS 3.0 参考手册 (中文版)下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F343.html&from=http%3A%2F%2Fjs8.in%2F647.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197221.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS 3.0 参考手册 (中文版)下载</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://js8.in/647.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>引入CSS 的两种方式：link和@import的区别</title>
		<link>http://js8.in/554.html</link>
		<comments>http://js8.in/554.html#comments</comments>
		<pubDate>Sun, 20 Jun 2010 04:37:44 +0000</pubDate>
		<dc:creator>三水清</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.js8.in/?p=554</guid>
		<description><![CDATA[引入css外部文件的两种方法为在html页面通过link，src属性（注意空链接时的陷阱！），再者是通过CSS文件本身通过@import引入，虽然这两种方式都可以加载进来CSS文件，可是link和@import也存在着细微的差别。<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="悼念地震，网站变灰CSS代码" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F528.html&from=http%3A%2F%2Fjs8.in%2F554.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/08/16/23067609.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">悼念地震，网站变灰CSS代码</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Less—让CSS如此简单" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F477.html&from=http%3A%2F%2Fjs8.in%2F554.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979339.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Less—让CSS如此简单</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS清除浏览器默认样式注意点" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F365.html&from=http%3A%2F%2Fjs8.in%2F554.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10981512.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS清除浏览器默认样式注意点</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用CSS设置文字反选的背景颜色" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F490.html&from=http%3A%2F%2Fjs8.in%2F554.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/06/11176425.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用CSS设置文字反选的背景颜色</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>引入<strong>css</strong>外部文件的两种方法为在html页面通过<strong>link</strong>，src属性（<a title="img,Script,Link等标签为空可导致页面多余请求" href="http://js8.in/555.html" target="_blank">注意空链接时的陷阱</a>！），再者是通过CSS文件本身通过<strong>@import url()</strong>引入，虽然这两种方式都可以加载进来CSS文件，可是link和@import也存在着细微的差别。</p>
<h3>隶属上的差别</h3>
<p>link属于XHTML标签，而@import完全是<strong>CSS</strong>提供的一种方式。link标签除了可以加载CSS外，还可以做很多其它的事情，比如定义RSS，定义rel连接属性等，@import就只能加载CSS了。此处注意<a title="img,Script,Link等标签为空可导致页面多余请求" href="http://js8.in/555.html" target="_blank">浏览器的link src为空时候时会导致页面加载次数增多</a>。</p>
<h3>@import次数限制</h3>
<p>传闻在IE6下，@import只能引入31次css文件，可是可以通过在css文件中再次import来垂直扩展，<a title="专注前端开发" href="http://js8.in" target="_blank">断桥残雪</a>没有测试过，不过如果出现这样的情况，说明这个写代码的人也挺变态的。</p>
<h3>加载顺序的不同</h3>
<p>当一个页面被加载的时候（就是被浏览者浏览的时候），link引用的CSS文件会同时被加载，而@import引用的CSS 会等到页面全部被下载完再被加载。所以有时候浏览@import加载CSS的页面时开始会没有样式，然后突然样式会出现，网速慢的时候还挺明显，@import这点跟把CSS文件放在页面结尾效果相同，不过如果我们一些样式开始页面并不会出现，而是在交互时才出现的CSS样式，可以通过这个方法引入，时间上错开。例如：Ajax的html，交互时的弹出框，弹出div等<br />
<span id="more-554"></span></p>
<h3>兼容性上的差别</h3>
<p>由于@import是CSS2.1提出的，@import只有在IE5以上的才能识别，而link标签无此问题（似乎影响不大~）。</p>
<h3>使用DOM控制样式时的差别</h3>
<p>当使用javascript控制DOM(<strong>document.styleSheets</strong>)去改变样式的时候，只能使用link标签，因为@import不是dom可以控制的。</p>
<p><span style="color: #ff6600;">所以，无特殊情况推荐使用link来引入样式，尽量避免使用@import，而如果进行Ajax或者交互的样式，则可以通过@import引入</span>
<div class="copyright">
<strong>声明：</strong>文章未声明为原创文章，本文链接 <a href="http://js8.in/554.html" title="引入CSS 的两种方式：link和@import的区别">http://js8.in/554.html</a>. 转载请注明转自<a href="http://js8.in" title="前端开发博客"> JS8.IN ™</a></span></span></div>
<h3 class="box-title">随机文章</h3>
<ul class="box_random">
<li><a href="http://js8.in/603.html" title="关于jQuery ready()方法一些用法解释" rel="bookmark inlinks">关于jQuery ready()方法一些用法解释</a></li>
<li><a href="http://js8.in/461.html" title="断桥残雪部落格更换新域名JS8.in" rel="bookmark inlinks">断桥残雪部落格更换新域名JS8.in</a></li>
<li><a href="http://js8.in/686.html" title="IE6下javascript不能隐藏select标签的bug" rel="bookmark inlinks">IE6下javascript不能隐藏select标签的bug</a></li>
<li><a href="http://js8.in/680.html" title="一份web前端开发的简历" rel="bookmark inlinks">一份web前端开发的简历</a></li>
<li><a href="http://js8.in/531.html" title="jQuery插件wBox准备更新" rel="bookmark inlinks">jQuery插件wBox准备更新</a></li>
<li><a href="http://js8.in/337.html" title="jQuery浏览器判断一个bug，以及修改建议" rel="bookmark inlinks">jQuery浏览器判断一个bug，以及修改建议</a></li>
<li><a href="http://js8.in/238.html" title="真正的jQuery的radio与checkbox取值" rel="bookmark inlinks">真正的jQuery的radio与checkbox取值</a></li>
<li><a href="http://js8.in/548.html" title="通过JSONP实现完美跨域" rel="bookmark inlinks">通过JSONP实现完美跨域</a></li>
</ul>
<hr />
<p><small>© 三水清 for <a href="http://js8.in">三水清</a>, 2010. |
<a href="http://js8.in/554.html#comments">No comment</a> |在微博关注我：<a href="//weibo.com/sanshuiqing" target="_blank" title="关注断桥残雪的新浪微博">@清-三水清</a>
<br/>收藏到：
<a rel="nofollow" href="http://share.renren.com/share/buttonshare.do?link=%posturl%&title=%posttitle%" title="收藏本文到人人网" target="_blank">人人网</a> | <a rel="nofollow" href="http://www.douban.com/recommend/?url=%posturl%&title=%posttitle%" title="收藏本文到豆瓣" target="_blank">豆瓣</a> | <a rel="nofollow" href="http://www.kaixin001.com/repaste/share.php?rtitle=%posttitle%&rurl=%posturl%" title="收藏本文到开心网" target="_blank">开心网</a> | <a rel="nofollow" href="http://shuqian.qq.com/post?title=%posttitle%&%20uri=%posturl%" title="收藏本文到QQ书签" target="_blank">QQ书签</a> | <a rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=%posturl%&title=%posttitle%" title="收藏本文到新浪微博" target="_blank">新浪微博</a> | <a rel="nofollow" href="http://v.t.qq.com/share/share.php?title=%posttitle%&url=%posturl%&site=http://www.kaixin100.info" title="收藏本文到腾讯微博" target="_blank">腾讯微博</a>
<br/>
Post tags: <a href="http://js8.in/tag/css" rel="tag">css</a><br/>
</small></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="悼念地震，网站变灰CSS代码" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F528.html&from=http%3A%2F%2Fjs8.in%2F554.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/08/16/23067609.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">悼念地震，网站变灰CSS代码</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Less—让CSS如此简单" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F477.html&from=http%3A%2F%2Fjs8.in%2F554.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979339.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Less—让CSS如此简单</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS清除浏览器默认样式注意点" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F365.html&from=http%3A%2F%2Fjs8.in%2F554.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10981512.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS清除浏览器默认样式注意点</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用CSS设置文字反选的背景颜色" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F490.html&from=http%3A%2F%2Fjs8.in%2F554.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/06/11176425.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用CSS设置文字反选的背景颜色</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://js8.in/554.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>悼念地震，网站变灰CSS代码</title>
		<link>http://js8.in/528.html</link>
		<comments>http://js8.in/528.html#comments</comments>
		<pubDate>Tue, 20 Apr 2010 10:15:07 +0000</pubDate>
		<dc:creator>三水清</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.js8.in/?p=528</guid>
		<description><![CDATA[为了悼念地震中遇害的同胞，国家规定明天开始悼念日~下面贴出来使用CSS的IE滤镜代码实现网站变灰白的效果代码<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Less—让CSS如此简单" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F477.html&from=http%3A%2F%2Fjs8.in%2F528.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979339.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Less—让CSS如此简单</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用CSS设置文字反选的背景颜色" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F490.html&from=http%3A%2F%2Fjs8.in%2F528.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/06/11176425.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用CSS设置文字反选的背景颜色</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS清除浏览器默认样式注意点" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F365.html&from=http%3A%2F%2Fjs8.in%2F528.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10981512.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS清除浏览器默认样式注意点</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS3 Media Queries使用方法详解" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F643.html&from=http%3A%2F%2Fjs8.in%2F528.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026785.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS3 Media Queries使用方法详解</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>为了悼念地震中遇害的同胞，国家规定明天开始悼念日~下面贴出来使用CSS的IE滤镜代码实现网站变灰白的效果代码，只在IE下有效~<br />
首先确定贵网站使用的是标准的doctype头，下面是html开头代码：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;</pre></div></div>

<p>然后使用下面的CSS代码</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">html <span style="color: #00AA00;">&#123;</span>
    filter<span style="color: #3333ff;">:progid</span><span style="color: #3333ff;">:DXImageTransform</span><span style="color: #6666ff;">.Microsoft</span>.BasicImage<span style="color: #00AA00;">&#40;</span>grayscale<span style="color: #00AA00;">=</span><span style="color: #cc66cc;">1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>如果贵网站有Flash，那么请在&lt;object&gt;和&lt;&#038;/object&gt;之间插入一下代码：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;param value=”false” name=”menu”/&gt;
&lt;param value=”opaque” name=”wmode”/&gt;</pre></div></div>

<div class="copyright">
<strong>声明：</strong>文章未声明为原创文章，本文链接 <a href="http://js8.in/528.html" title="悼念地震，网站变灰CSS代码">http://js8.in/528.html</a>. 转载请注明转自<a href="http://js8.in" title="前端开发博客"> JS8.IN ™</a></span></span></div>
<h3 class="box-title">随机文章</h3>
<ul class="box_random">
<li><a href="http://js8.in/688.html" title="使用windows7的virtual PC打造原装IE6、IE7、IE8测试环境" rel="bookmark inlinks">使用windows7的virtual PC打造原装IE6、IE7、IE8测试环境</a></li>
<li><a href="http://js8.in/620.html" title="关于wBox iFrame回调关闭问题的解决方案" rel="bookmark inlinks">关于wBox iFrame回调关闭问题的解决方案</a></li>
<li><a href="http://js8.in/552.html" title="2010年世界杯比赛时间表-北京时间" rel="bookmark inlinks">2010年世界杯比赛时间表-北京时间</a></li>
<li><a href="http://js8.in/570.html" title="十枚腾讯微博内测邀请的种子" rel="bookmark inlinks">十枚腾讯微博内测邀请的种子</a></li>
<li><a href="http://js8.in/607.html" title="提高Firefox的innerHTML()的性能" rel="bookmark inlinks">提高Firefox的innerHTML()的性能</a></li>
<li><a href="http://js8.in/337.html" title="jQuery浏览器判断一个bug，以及修改建议" rel="bookmark inlinks">jQuery浏览器判断一个bug，以及修改建议</a></li>
<li><a href="http://js8.in/558.html" title="onbeforeunload与a标签在IE中的冲突bug" rel="bookmark inlinks">onbeforeunload与a标签在IE中的冲突bug</a></li>
<li><a href="http://js8.in/501.html" title="IE中Image.onload失效的问题" rel="bookmark inlinks">IE中Image.onload失效的问题</a></li>
</ul>
<hr />
<p><small>© 三水清 for <a href="http://js8.in">三水清</a>, 2010. |
<a href="http://js8.in/528.html#comments">9 comments</a> |在微博关注我：<a href="//weibo.com/sanshuiqing" target="_blank" title="关注断桥残雪的新浪微博">@清-三水清</a>
<br/>收藏到：
<a rel="nofollow" href="http://share.renren.com/share/buttonshare.do?link=%posturl%&title=%posttitle%" title="收藏本文到人人网" target="_blank">人人网</a> | <a rel="nofollow" href="http://www.douban.com/recommend/?url=%posturl%&title=%posttitle%" title="收藏本文到豆瓣" target="_blank">豆瓣</a> | <a rel="nofollow" href="http://www.kaixin001.com/repaste/share.php?rtitle=%posttitle%&rurl=%posturl%" title="收藏本文到开心网" target="_blank">开心网</a> | <a rel="nofollow" href="http://shuqian.qq.com/post?title=%posttitle%&%20uri=%posturl%" title="收藏本文到QQ书签" target="_blank">QQ书签</a> | <a rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=%posturl%&title=%posttitle%" title="收藏本文到新浪微博" target="_blank">新浪微博</a> | <a rel="nofollow" href="http://v.t.qq.com/share/share.php?title=%posttitle%&url=%posturl%&site=http://www.kaixin100.info" title="收藏本文到腾讯微博" target="_blank">腾讯微博</a>
<br/>
Post tags: <a href="http://js8.in/tag/css" rel="tag">css</a><br/>
</small></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Less—让CSS如此简单" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F477.html&from=http%3A%2F%2Fjs8.in%2F528.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979339.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Less—让CSS如此简单</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用CSS设置文字反选的背景颜色" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F490.html&from=http%3A%2F%2Fjs8.in%2F528.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/06/11176425.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用CSS设置文字反选的背景颜色</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS清除浏览器默认样式注意点" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F365.html&from=http%3A%2F%2Fjs8.in%2F528.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10981512.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS清除浏览器默认样式注意点</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS3 Media Queries使用方法详解" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F643.html&from=http%3A%2F%2Fjs8.in%2F528.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026785.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS3 Media Queries使用方法详解</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://js8.in/528.html/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>使用CSS设置文字反选的背景颜色</title>
		<link>http://js8.in/490.html</link>
		<comments>http://js8.in/490.html#comments</comments>
		<pubDate>Mon, 22 Feb 2010 03:51:39 +0000</pubDate>
		<dc:creator>三水清</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[网络技术]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.js8.in/?p=490</guid>
		<description><![CDATA[本文通过设置css解决html页面中反选文字背景颜色的问题，也许很多人对这个问题不是很在意，也可能你早就见到过这个效果了，但是却忽略了。<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Less—让CSS如此简单" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F477.html&from=http%3A%2F%2Fjs8.in%2F490.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979339.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Less—让CSS如此简单</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="引入CSS 的两种方式：link和@import的区别" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F554.html&from=http%3A%2F%2Fjs8.in%2F490.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026361.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">引入CSS 的两种方式：link和@import的区别</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS3 Media Queries使用方法详解" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F643.html&from=http%3A%2F%2Fjs8.in%2F490.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026785.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS3 Media Queries使用方法详解</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS 3.0 参考手册 (中文版)下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F343.html&from=http%3A%2F%2Fjs8.in%2F490.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197221.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS 3.0 参考手册 (中文版)下载</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>在计算机操作中经常会有<strong>反选</strong>出现，系统一般会根据选择区域的颜色，显示出补色。但windows默认的文字选择时，背景为蓝色，前景色为白色，如果背景是深色，则文字为蓝色，<strong>背景</strong>变成白色。如下图所示：</p>
<div id="attachment_489" class="wp-caption aligncenter" style="width: 518px"><a href="http://js8.in/wp-content/uploads/2010/02/b201022115279.gif"><img class="size-full wp-image-489 " title="反选默认样式" src="http://js8.in/wp-content/uploads/2010/02/b201022115279.gif" alt="反选默认样式" width="508" height="38" /></a><p class="wp-caption-text">反选默认样式</p></div>
<p>能不能改变选择的默认颜色呢，也许很多人对这个问题不是很在意，也可能你早就见到过这个效果了，但是却忽略了。<a target="_blank" href="http://www.quirksmode.org/css/selection.html" target="_blank">查看示例</a>(<span style="color: #00ccff;">请在非IE浏览器下查看</span>)</p>
<p>从博客里可以看到PPK给出了如下的CSS代码：</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #00AA00;">:</span><span style="color: #3333ff;">:-moz-selection</span><span style="color: #00AA00;">&#123;</span>    <span style="color: #808080; font-style: italic;">/*针对Firefox*/</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#cc0000</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #00AA00;">:</span><span style="color: #3333ff;">:selection </span><span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#cc0000</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
code<span style="color: #00AA00;">:</span><span style="color: #3333ff;">:-moz-selection </span><span style="color: #00AA00;">&#123;</span>  <span style="color: #808080; font-style: italic;">/*code是标签选择器，可以换成p或span等*/</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#333333</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
code<span style="color: #00AA00;">:</span><span style="color: #3333ff;">:selection </span><span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#333333</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

</blockquote>
<p>通过以上代码可以看出，你完全可以给不同的容器定义不同的反选背景颜色，
<div class="copyright">
<strong>声明：</strong>文章未声明为原创文章，本文链接 <a href="http://js8.in/490.html" title="使用CSS设置文字反选的背景颜色">http://js8.in/490.html</a>. 转载请注明转自<a href="http://js8.in" title="前端开发博客"> JS8.IN ™</a></span></span></div>
<h3 class="box-title">随机文章</h3>
<ul class="box_random">
<li><a href="http://js8.in/711.html" title="host配置：设置电脑DNS解析文件host" rel="bookmark inlinks">host配置：设置电脑DNS解析文件host</a></li>
<li><a href="http://js8.in/533.html" title="QQ概念版已经开放下载使用" rel="bookmark inlinks">QQ概念版已经开放下载使用</a></li>
<li><a href="http://js8.in/551.html" title="一款模仿Mac的windows7主题包" rel="bookmark inlinks">一款模仿Mac的windows7主题包</a></li>
<li><a href="http://js8.in/688.html" title="使用windows7的virtual PC打造原装IE6、IE7、IE8测试环境" rel="bookmark inlinks">使用windows7的virtual PC打造原装IE6、IE7、IE8测试环境</a></li>
<li><a href="http://js8.in/425.html" title="淘江湖钱庄抽奖技巧" rel="bookmark inlinks">淘江湖钱庄抽奖技巧</a></li>
<li><a href="http://js8.in/534.html" title="官方中文正式原版PhotoShop CS5下载" rel="bookmark inlinks">官方中文正式原版PhotoShop CS5下载</a></li>
<li><a href="http://js8.in/21.html" title="网站首页做完了~i.2fool.cn" rel="bookmark inlinks">网站首页做完了~i.2fool.cn</a></li>
<li><a href="http://js8.in/334.html" title="页面设计的10免费图标组合" rel="bookmark inlinks">页面设计的10免费图标组合</a></li>
</ul>
<hr />
<p><small>© 三水清 for <a href="http://js8.in">三水清</a>, 2010. |
<a href="http://js8.in/490.html#comments">No comment</a> |在微博关注我：<a href="//weibo.com/sanshuiqing" target="_blank" title="关注断桥残雪的新浪微博">@清-三水清</a>
<br/>收藏到：
<a rel="nofollow" href="http://share.renren.com/share/buttonshare.do?link=%posturl%&title=%posttitle%" title="收藏本文到人人网" target="_blank">人人网</a> | <a rel="nofollow" href="http://www.douban.com/recommend/?url=%posturl%&title=%posttitle%" title="收藏本文到豆瓣" target="_blank">豆瓣</a> | <a rel="nofollow" href="http://www.kaixin001.com/repaste/share.php?rtitle=%posttitle%&rurl=%posturl%" title="收藏本文到开心网" target="_blank">开心网</a> | <a rel="nofollow" href="http://shuqian.qq.com/post?title=%posttitle%&%20uri=%posturl%" title="收藏本文到QQ书签" target="_blank">QQ书签</a> | <a rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=%posturl%&title=%posttitle%" title="收藏本文到新浪微博" target="_blank">新浪微博</a> | <a rel="nofollow" href="http://v.t.qq.com/share/share.php?title=%posttitle%&url=%posturl%&site=http://www.kaixin100.info" title="收藏本文到腾讯微博" target="_blank">腾讯微博</a>
<br/>
Post tags: <a href="http://js8.in/tag/css" rel="tag">css</a><br/>
</small></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Less—让CSS如此简单" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F477.html&from=http%3A%2F%2Fjs8.in%2F490.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979339.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Less—让CSS如此简单</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="引入CSS 的两种方式：link和@import的区别" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F554.html&from=http%3A%2F%2Fjs8.in%2F490.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026361.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">引入CSS 的两种方式：link和@import的区别</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS3 Media Queries使用方法详解" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F643.html&from=http%3A%2F%2Fjs8.in%2F490.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026785.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS3 Media Queries使用方法详解</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS 3.0 参考手册 (中文版)下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F343.html&from=http%3A%2F%2Fjs8.in%2F490.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197221.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS 3.0 参考手册 (中文版)下载</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://js8.in/490.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS+jQuery实现滑动幻灯片实例详解</title>
		<link>http://js8.in/479.html</link>
		<comments>http://js8.in/479.html#comments</comments>
		<pubDate>Tue, 09 Feb 2010 02:18:01 +0000</pubDate>
		<dc:creator>三水清</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[网络技术]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.js8.in/?p=479</guid>
		<description><![CDATA[今天我看见一个比较不错的jQuery幻灯片教程，比我之前的文章《两个简单的jQuery幻灯片实例》写的更为详细，并且有框架布局的演示图片，特地转载来，部分英文不翻译了，很简单的~<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="三种常见jQuery幻灯片（jQuery slider）制作教程" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F668.html&from=http%3A%2F%2Fjs8.in%2F479.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10978807.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">三种常见jQuery幻灯片（jQuery slider）制作教程</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Less—让CSS如此简单" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F477.html&from=http%3A%2F%2Fjs8.in%2F479.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979339.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Less—让CSS如此简单</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="悼念地震，网站变灰CSS代码" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F528.html&from=http%3A%2F%2Fjs8.in%2F479.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/08/16/23067609.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">悼念地震，网站变灰CSS代码</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="25大实用的jQuery技巧和解决方案" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F507.html&from=http%3A%2F%2Fjs8.in%2F479.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10992028.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">25大实用的jQuery技巧和解决方案</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>今天我看见一个比较不错的<strong>jQuery幻灯片</strong>教程，比我之前的文章《<a title="两个简单的jQuery幻灯片实例" href="http://js8.in/462.html" target="_blank">两个简单的jQuery幻灯片实例</a>》写的更为详细，并且有框架布局的演示图片，特地转载来，部分英文不翻译了，很简单的~</p>
<h3>HTML部分代码</h3>
<p>Start with having a wrapping container div called <em>main_view</em>, and two sections nested inside called <em>image_reel</em> and <em>paging.</em> The <em>image_reel </em>will contain the sliding images, and <em>paging</em> contains the paging controls. Take a look at the image below for a visual.</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;main_view&quot;&gt;
    &lt;div class=&quot;window&quot;&gt;
        &lt;div class=&quot;image_reel&quot;&gt;
            &lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;reel_1.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
            &lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;reel_2.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
            &lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;reel_3.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
            &lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;reel_4.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;paging&quot;&gt;
        &lt;a href=&quot;#&quot; rel=&quot;1&quot;&gt;1&lt;/a&gt;
        &lt;a href=&quot;#&quot; rel=&quot;2&quot;&gt;2&lt;/a&gt;
        &lt;a href=&quot;#&quot; rel=&quot;3&quot;&gt;3&lt;/a&gt;
        &lt;a href=&quot;#&quot; rel=&quot;4&quot;&gt;4&lt;/a&gt;
    &lt;/div&gt;
&lt;/div&gt;</pre></div></div>

</blockquote>
<div id="attachment_478" class="wp-caption aligncenter" style="width: 585px"><a href="http://js8.in/mywork/jq_slider/"><img class="size-full wp-image-478" title="css+jQuery实现滑动幻灯片实例教程" src="http://js8.in/wp-content/uploads/2010/02/1.jpg" alt="css+jQuery实现滑动幻灯片实例教程" width="575" height="270" /></a><p class="wp-caption-text">css+jQuery实现滑动幻灯片实例教程</p></div><br />
<span id="more-479"></span></p>
<h3>CSS部分代码</h3>
<p>Take a look at the comments below for an explanation of the styles.</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*--Main Container--*/</span>
<span style="color: #6666ff;">.main_view</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #808080; font-style: italic;">/*--Window/Masking Styles--*/</span>
<span style="color: #6666ff;">.window</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">286px</span><span style="color: #00AA00;">;</span>	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">790px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*--Hides anything outside of the set width/height--*/</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.image_reel</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.image_reel</span> img <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*--Paging Styles--*/</span>
<span style="color: #6666ff;">.paging</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">40px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-7px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">178px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">47px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">100</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*--Assures the paging stays on the top layer--*/</span>
	<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">40px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span>paging_bg2.png<span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*--Hidden by default, will be later shown with jQuery--*/</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.paging</span> a <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.paging</span> a<span style="color: #6666ff;">.active</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#920000</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#610000</span><span style="color: #00AA00;">;</span>
	-moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
	-khtml-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
	-webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.paging</span> a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

</blockquote>
<h3>JS部分代码</h3>
<p>The following script contains comments explaining which jQuery actions are being performed.<br />
<strong>1.Setting up the Image Slider</strong><br />
Start by showing the paging and activating the first link. Then we will calculate and adjust the width of the <em>image_reel </em>according to how many slides there are.</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//Show the paging and activate its first link</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.paging&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.paging a:first&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;active&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//Get size of the image, how many images there are, then determin the size of the image reel.</span>
<span style="color: #003366; font-weight: bold;">var</span> imageWidth <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.window&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> imageSum <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.image_reel img&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> imageReelWidth <span style="color: #339933;">=</span> imageWidth <span style="color: #339933;">*</span> imageSum<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//Adjust the image reel to its new size</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.image_reel&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'width'</span> <span style="color: #339933;">:</span> imageReelWidth<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<p><strong>2.Setting up the Slider Function and Timer</strong><br />
We first create the function for the slide event by itself (<em>rotate</em>). Then create another function (<em>rotateSwitch</em>) that will rotate and repeat that slide event (rotate).</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//Paging  and Slider Function</span>
rotate <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> triggerID <span style="color: #339933;">=</span> $active.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;rel&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Get number of times to slide</span>
    <span style="color: #003366; font-weight: bold;">var</span> image_reelPosition <span style="color: #339933;">=</span> triggerID <span style="color: #339933;">*</span> imageWidth<span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Determines the distance the image reel needs to slide</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.paging a&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'active'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Remove all active class</span>
    $active.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'active'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Add active class (the $active is declared in the rotateSwitch function)</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">//Slider Animation</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.image_reel&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        left<span style="color: #339933;">:</span> <span style="color: #339933;">-</span>image_reelPosition
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">500</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #006600; font-style: italic;">//Rotation  and Timing Event</span>
rotateSwitch <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    play <span style="color: #339933;">=</span> setInterval<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//Set timer - this will repeat itself every 7 seconds</span>
        $active <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.paging a.active'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Move to the next paging</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> $active.<span style="color: #660066;">length</span> <span style="color: #339933;">===</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//If paging reaches the end...</span>
            $active <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.paging a:first'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//go back to first</span>
        <span style="color: #009900;">&#125;</span>
        rotate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Trigger the paging and slider function</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">7000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Timer speed in milliseconds (7 seconds)</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
rotateSwitch<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Run function on launch</span></pre></div></div>

</blockquote>
<p>Take a look at this <a target="_blank" href="http://jquery-howto.blogspot.com/2009/04/ajax-update-content-every-x-seconds.html" target="_blank">tutorial</a> for an explanation of how the timer (<em>setInterval</em>) works.</p>
<p><strong>3.Hover and Click Events</strong><br />
In case the user wants to view the slide for a longer period of time, we will allow the slider to stop when it is hovered. Another thing to consider is we should reset the timer each time the paging is clicked. This will prevent unexpected slide switches and allow for a smoother experience.</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//On Hover</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.image_reel a&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    clearInterval<span style="color: #009900;">&#40;</span>play<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Stop the rotation</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    rotateSwitch<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Resume rotation timer</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
&nbsp;
<span style="color: #006600; font-style: italic;">//On Click</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.paging a&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    $active <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Activate the clicked paging</span>
    <span style="color: #006600; font-style: italic;">//Reset Timer</span>
    clearInterval<span style="color: #009900;">&#40;</span>play<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Stop the rotation</span>
    rotateSwitch<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Resume rotation timer</span>
    rotate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Trigger rotation immediately</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Prevent browser jump to link anchor</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<p><div id="attachment_478" class="wp-caption aligncenter" style="width: 585px"><a href="http://js8.in/wp-content/uploads/2010/02/1.jpg"><img class="size-full wp-image-478" title="css+jQuery实现滑动幻灯片实例教程" src="http://js8.in/wp-content/uploads/2010/02/1.jpg" alt="css+jQuery实现滑动幻灯片实例教程" width="575" height="270" /></a><p class="wp-caption-text">css+jQuery实现滑动幻灯片实例教程</p></div>
<p class="demoview"><a target="_blank" href="http://js8.in/mywork/jq_slider/" >查看演示</a></p>
<h3>一些网站实例</h3>
<p>Below are some sites that use similar techniques, check them out for inspiration!</p>
<p style="text-align: center;"><a target="_blank" href="http://www.netdreams.co.uk/" target="_blank"><img class="center aligncenter" src="http://www.sohtanaka.com/web-design/examples/image-slider/sample1.jpg" alt="Automatic Image Slider CSS jQuery" width="575" height="270" /></a></p>
<p><a target="_blank" href="http://tutorial9.com/" target="_blank"><img class="center" src="http://www.sohtanaka.com/web-design/examples/image-slider/sample2.jpg" alt="Automatic Image Slider CSS jQuery" /></a></p>
<p><a target="_blank" href="http://radiumlabs.com/" target="_blank"><img class="center" src="http://www.sohtanaka.com/web-design/examples/image-slider/sample3.jpg" alt="Automatic Image Slider CSS jQuery" /></a></p>
<p><a target="_blank" href="http://www.bigspaceship.com/" target="_blank"><img class="center" src="http://www.sohtanaka.com/web-design/examples/image-slider/sample4.jpg" alt="Automatic Image Slider CSS jQuery" /></a></p>
<p><a target="_blank" href="http://electricpulp.com/" target="_blank"><img class="center" src="http://www.sohtanaka.com/web-design/examples/image-slider/sample5.jpg" alt="Automatic Image Slider CSS jQuery" /></a>
<div class="copyright">
<strong>声明：</strong>文章未声明为原创文章，本文链接 <a href="http://js8.in/479.html" title="CSS+jQuery实现滑动幻灯片实例详解">http://js8.in/479.html</a>. 转载请注明转自<a href="http://js8.in" title="前端开发博客"> JS8.IN ™</a></span></span></div>
<h3 class="box-title">随机文章</h3>
<ul class="box_random">
<li><a href="http://js8.in/534.html" title="官方中文正式原版PhotoShop CS5下载" rel="bookmark inlinks">官方中文正式原版PhotoShop CS5下载</a></li>
<li><a href="http://js8.in/548.html" title="通过JSONP实现完美跨域" rel="bookmark inlinks">通过JSONP实现完美跨域</a></li>
<li><a href="http://js8.in/25.html" title="Adobe紧急发布flash Clickjacking漏洞暂时的解决方案" rel="bookmark inlinks">Adobe紧急发布flash Clickjacking漏洞暂时的解决方案</a></li>
<li><a href="http://js8.in/308.html" title="根据IP返回地理位置地址以及地理经纬度的方法" rel="bookmark inlinks">根据IP返回地理位置地址以及地理经纬度的方法</a></li>
<li><a href="http://js8.in/473.html" title="Javascript正则表达式详解" rel="bookmark inlinks">Javascript正则表达式详解</a></li>
<li><a href="http://js8.in/52.html" title="万众期待的Ajax评论发布啦-dedecms扩展工具" rel="bookmark inlinks">万众期待的Ajax评论发布啦-dedecms扩展工具</a></li>
<li><a href="http://js8.in/580.html" title="爱墙（许愿墙）程序后台添加置顶、搜索等功能" rel="bookmark inlinks">爱墙（许愿墙）程序后台添加置顶、搜索等功能</a></li>
<li><a href="http://js8.in/547.html" title="去掉Eclipse插件Aptana启动显示My Aptana" rel="bookmark inlinks">去掉Eclipse插件Aptana启动显示My Aptana</a></li>
</ul>
<hr />
<p><small>© 三水清 for <a href="http://js8.in">三水清</a>, 2010. |
<a href="http://js8.in/479.html#comments">2 comments</a> |在微博关注我：<a href="//weibo.com/sanshuiqing" target="_blank" title="关注断桥残雪的新浪微博">@清-三水清</a>
<br/>收藏到：
<a rel="nofollow" href="http://share.renren.com/share/buttonshare.do?link=%posturl%&title=%posttitle%" title="收藏本文到人人网" target="_blank">人人网</a> | <a rel="nofollow" href="http://www.douban.com/recommend/?url=%posturl%&title=%posttitle%" title="收藏本文到豆瓣" target="_blank">豆瓣</a> | <a rel="nofollow" href="http://www.kaixin001.com/repaste/share.php?rtitle=%posttitle%&rurl=%posturl%" title="收藏本文到开心网" target="_blank">开心网</a> | <a rel="nofollow" href="http://shuqian.qq.com/post?title=%posttitle%&%20uri=%posturl%" title="收藏本文到QQ书签" target="_blank">QQ书签</a> | <a rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=%posturl%&title=%posttitle%" title="收藏本文到新浪微博" target="_blank">新浪微博</a> | <a rel="nofollow" href="http://v.t.qq.com/share/share.php?title=%posttitle%&url=%posturl%&site=http://www.kaixin100.info" title="收藏本文到腾讯微博" target="_blank">腾讯微博</a>
<br/>
Post tags: <a href="http://js8.in/tag/css" rel="tag">css</a>, <a href="http://js8.in/tag/jquery" rel="tag">jquery</a><br/>
</small></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="三种常见jQuery幻灯片（jQuery slider）制作教程" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F668.html&from=http%3A%2F%2Fjs8.in%2F479.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10978807.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">三种常见jQuery幻灯片（jQuery slider）制作教程</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Less—让CSS如此简单" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F477.html&from=http%3A%2F%2Fjs8.in%2F479.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979339.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Less—让CSS如此简单</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="悼念地震，网站变灰CSS代码" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F528.html&from=http%3A%2F%2Fjs8.in%2F479.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/08/16/23067609.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">悼念地震，网站变灰CSS代码</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="25大实用的jQuery技巧和解决方案" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F507.html&from=http%3A%2F%2Fjs8.in%2F479.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10992028.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">25大实用的jQuery技巧和解决方案</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://js8.in/479.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Less—让CSS如此简单</title>
		<link>http://js8.in/477.html</link>
		<comments>http://js8.in/477.html#comments</comments>
		<pubDate>Mon, 08 Feb 2010 01:47:27 +0000</pubDate>
		<dc:creator>三水清</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[网络技术]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.js8.in/477.html</guid>
		<description><![CDATA[less 的出现便是为了解决浏览器兼容这个问题：在现有CSS syntax 的基础上，为CSS 加入程式语言的特性，包括变数、scope、nested rules、运算、继承。<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="使用CSS设置文字反选的背景颜色" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F490.html&from=http%3A%2F%2Fjs8.in%2F477.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/06/11176425.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用CSS设置文字反选的背景颜色</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="引入CSS 的两种方式：link和@import的区别" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F554.html&from=http%3A%2F%2Fjs8.in%2F477.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026361.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">引入CSS 的两种方式：link和@import的区别</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="前端必须熟悉的10个CSS3属性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F648.html&from=http%3A%2F%2Fjs8.in%2F477.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/11013672.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">前端必须熟悉的10个CSS3属性</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS清除浏览器默认样式注意点" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F365.html&from=http%3A%2F%2Fjs8.in%2F477.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10981512.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS清除浏览器默认样式注意点</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://js8.in/wp-content/uploads/2010/02/less.png"><img class="aligncenter size-full wp-image-476" title="less" src="http://js8.in/wp-content/uploads/2010/02/less.png" alt="less" width="480" height="96" /></a></p>
<p>写<strong>CSS</strong> 最痛苦的是要搞定一堆<strong>浏览器兼容</strong>bug ，其次就是要面对CSS 不是programming language 这现实，不存在其他程式语言常见的变数、运算、继承等概念，使原本简单的工作变得冗长，并且使维护工作变得麻烦。<br />
<strong>less</strong> 的出现便是为了解决这个问题：在现有CSS syntax 的基础上，为CSS 加入程式语言的特性，包括变数、scope、nested rules、运算、继承。<br />
看例子你便会明白：</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@brand_color: #F0F;</span>
&nbsp;
<span style="color: #cc00cc;">#container</span> <span style="color: #00AA00;">&#123;</span>
div <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@brand_color;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
p <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@brand_color;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><span id="more-477"></span>这例子应该很容易理解吧，相等于以往的：</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#container</span> div <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#F0F</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#container</span> p <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#F0F</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>坏消息是，用less 写成的档案需要在Unix based 的电脑上编译过后方能变成真正的CSS；好消息是，有人写了个小工具less.app 可以完成这项工作，使不懂得用terminal的用户也能够使用。在 window 下貌似没有简单的解法…<br />
less 官方网站：<a target="_blank" href="http://lesscss.org/" target="_self">http://lesscss.org/</a><br />
less.app (GUI): <a target="_blank" href="http://incident57.com/less/" target="_blank">http://incident57.com/less/</a>
<div class="copyright">
<strong>声明：</strong>文章未声明为原创文章，本文链接 <a href="http://js8.in/477.html" title="Less—让CSS如此简单">http://js8.in/477.html</a>. 转载请注明转自<a href="http://js8.in" title="前端开发博客"> JS8.IN ™</a></span></span></div>
<h3 class="box-title">随机文章</h3>
<ul class="box_random">
<li><a href="http://js8.in/564.html" title="Google Map API教程之使用GControl对象在地图上添加control按钮" rel="bookmark inlinks">Google Map API教程之使用GControl对象在地图上添加control按钮</a></li>
<li><a href="http://js8.in/23.html" title="园艺学院网站内测！开始，欢迎访问" rel="bookmark inlinks">园艺学院网站内测！开始，欢迎访问</a></li>
<li><a href="http://js8.in/902.html" title="IE6中javascript文件开启Gzip出现代码不执行情况" rel="bookmark inlinks">IE6中javascript文件开启Gzip出现代码不执行情况</a></li>
<li><a href="http://js8.in/664.html" title="iframe自适用高度代码" rel="bookmark inlinks">iframe自适用高度代码</a></li>
<li><a href="http://js8.in/586.html" title="通过PHP批量下载图片文件" rel="bookmark inlinks">通过PHP批量下载图片文件</a></li>
<li><a href="http://js8.in/574.html" title="只要20元，你也可以做个QQ爱墙" rel="bookmark inlinks">只要20元，你也可以做个QQ爱墙</a></li>
<li><a href="http://js8.in/46.html" title="如何写网站的robots.txt和meta name robots的配置" rel="bookmark inlinks">如何写网站的robots.txt和meta name robots的配置</a></li>
<li><a href="http://js8.in/335.html" title="Sql语句优化注意" rel="bookmark inlinks">Sql语句优化注意</a></li>
</ul>
<hr />
<p><small>© 三水清 for <a href="http://js8.in">三水清</a>, 2010. |
<a href="http://js8.in/477.html#comments">One comment</a> |在微博关注我：<a href="//weibo.com/sanshuiqing" target="_blank" title="关注断桥残雪的新浪微博">@清-三水清</a>
<br/>收藏到：
<a rel="nofollow" href="http://share.renren.com/share/buttonshare.do?link=%posturl%&title=%posttitle%" title="收藏本文到人人网" target="_blank">人人网</a> | <a rel="nofollow" href="http://www.douban.com/recommend/?url=%posturl%&title=%posttitle%" title="收藏本文到豆瓣" target="_blank">豆瓣</a> | <a rel="nofollow" href="http://www.kaixin001.com/repaste/share.php?rtitle=%posttitle%&rurl=%posturl%" title="收藏本文到开心网" target="_blank">开心网</a> | <a rel="nofollow" href="http://shuqian.qq.com/post?title=%posttitle%&%20uri=%posturl%" title="收藏本文到QQ书签" target="_blank">QQ书签</a> | <a rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=%posturl%&title=%posttitle%" title="收藏本文到新浪微博" target="_blank">新浪微博</a> | <a rel="nofollow" href="http://v.t.qq.com/share/share.php?title=%posttitle%&url=%posturl%&site=http://www.kaixin100.info" title="收藏本文到腾讯微博" target="_blank">腾讯微博</a>
<br/>
Post tags: <a href="http://js8.in/tag/css" rel="tag">css</a><br/>
</small></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="使用CSS设置文字反选的背景颜色" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F490.html&from=http%3A%2F%2Fjs8.in%2F477.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/06/11176425.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用CSS设置文字反选的背景颜色</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="引入CSS 的两种方式：link和@import的区别" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F554.html&from=http%3A%2F%2Fjs8.in%2F477.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026361.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">引入CSS 的两种方式：link和@import的区别</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="前端必须熟悉的10个CSS3属性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F648.html&from=http%3A%2F%2Fjs8.in%2F477.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/11013672.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">前端必须熟悉的10个CSS3属性</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS清除浏览器默认样式注意点" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F365.html&from=http%3A%2F%2Fjs8.in%2F477.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10981512.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS清除浏览器默认样式注意点</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://js8.in/477.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>png在IE6下透明的几种方法</title>
		<link>http://js8.in/448.html</link>
		<comments>http://js8.in/448.html#comments</comments>
		<pubDate>Fri, 15 Jan 2010 02:47:44 +0000</pubDate>
		<dc:creator>三水清</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[网络技术]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.js8.in/?p=448</guid>
		<description><![CDATA[png透明针对IE6一直是件挺麻烦的事情，使用的方法也是各有不同，大多的原理是用IE的滤镜来解决的。本文通过css方法、js方法、htc三种方法来实现IE6下png透明，其中断桥残雪推荐使用htc方法<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="IE6下javascript不能隐藏select标签的bug" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F686.html&from=http%3A%2F%2Fjs8.in%2F448.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10987937.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">IE6下javascript不能隐藏select标签的bug</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="IE6 PNG图片不透明问题的解决方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F380.html&from=http%3A%2F%2Fjs8.in%2F448.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/01/2770440.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">IE6 PNG图片不透明问题的解决方法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="解决IE6 select z-index无效，遮挡div的bug" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F553.html&from=http%3A%2F%2Fjs8.in%2F448.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10987560.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">解决IE6 select z-index无效，遮挡div的bug</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="解决IE6不支持max-height的bug" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F606.html&from=http%3A%2F%2Fjs8.in%2F448.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10978851.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">解决IE6不支持max-height的bug</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>断桥残雪在《<a href="http://js8.in/380.html" target="_blank" title="IE6 PNG图片不透明问题的解决方法">IE6 PNG图片不透明问题的解决方法</a>》中提到了使用js来解决IE6下PNG图片不透明的问题，今天我总结一下png在IE6下透明的方法：<strong>css方法</strong>、<strong>js方法</strong>、<strong>htc方法</strong>。</p>
<p>png透明针对IE6一直是件挺麻烦的事情，使用的方法也是各有不同，大多的原理是用IE的滤镜来解决的。</p>
<blockquote><p>语法：<br />
filter : progid:DXImageTransform.Microsoft.AlphaImageLoader ( enabled=bEnabled , sizingMethod=sSize , src=sURL )</p>
<p style="text-indent:0">enabled : 可选项。布尔值(Boolean)。设置或检索滤镜是否激活。true | false true : 默认值。滤镜激活。<br />
false : 滤镜被禁止。<br />
sizingMethod : 可选项。字符串(String)。设置或检索滤镜作用的对象的图片在对象容器边界内的显示方式。 crop : 剪切图片以适应对象尺寸。<br />
image : 默认值。增大或减小对象的尺寸边界以适应图片的尺寸。scale : 缩放图片以适应对象的尺寸边界。<br />
src : 必选项。字符串(String)。使用绝对或相对 url 地址指定背景图像。假如忽略此参数，滤镜将不会作用。</p>
</blockquote>
<p>现在一般在使用的方法有以下几种：<br />
<span id="more-448"></span></p>
<h3>1、css方法</h3>
<blockquote><p>
<strong>css</strong>：</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.pngs</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">90px</span><span style="color: #00AA00;">;</span>width<span style="color: #00AA00;">:</span> <span style="color: #933;">90px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">icon_home.png</span><span style="color: #00AA00;">&#41;</span>!important<span style="color: #00AA00;">;</span>  <span style="color: #808080; font-style: italic;">/* FF IE7 */</span>
<span style="color: #000000; font-weight: bold;">background-repeat</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span> _filter<span style="color: #00AA00;">:</span> progid<span style="color: #3333ff;">:DXImageTransform</span><span style="color: #6666ff;">.Microsoft</span>.AlphaImageLoader<span style="color: #00AA00;">&#40;</span>src<span style="color: #00AA00;">=</span>’icon_home.png’<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>  <span style="color: #808080; font-style: italic;">/* IE6 */</span>
_ <span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* IE6 */</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><strong>xhtml</strong>：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class=”pngs”&gt;&lt;/div&gt;</pre></div></div>

</blockquote>
<p>这种方法的优点就是使用简单方便，但是不能作为背景，且只能用作单个png图片的使用。如果要作为背景，需要新增加一个div层，并设置其position:relative;</p>
<blockquote><p>
<strong>css</strong>：</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.png</span> div<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><strong>xhml</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class=’png’&gt;
&lt;div&gt;
CSS 背景PNG透明 及 链接失效问题解决
&lt;/div&gt;
&lt;/div&gt;</pre></div></div>

</blockquote>
<p>这种方法可以使用在那些png图片不多，且不需要repeat的情况下。</p>
<h3>2、js方法</h3>
<pre lang=”javascript”>
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 &#038; 6.
{
    var arVersion = navigator.appVersion.split(“MSIE”)
    var version = parseFloat(arVersion[1])
    if ((version >= 5.5) &#038;&#038; (document.body.filters))
    {
       for(var j=0; j<document.images.length; j++)
       {
          var img = document.images[j]
          var imgName = img.src.toUpperCase()
          if (imgName.substring(imgName.length-3, imgName.length) == “PNG”)
          {
             var imgID = (img.id) ? “id=’” + img.id + “‘ ” : “”
             var imgClass = (img.className) ? “class=’” + img.className + “‘ ” : “”
             var imgTitle = (img.title) ? “title=’” + img.title + “‘ ” : “title=’” + img.alt + “‘ ”
             var imgStyle = “display:inline-block;” + img.style.cssText
             if (img.align == “left”) imgStyle = “float:left;” + imgStyle
             if (img.align == “right”) imgStyle = “float:right;” + imgStyle
             if (img.parentElement.href) imgStyle = “cursor:hand;” + imgStyle
             var strNewHTML = “<span ” + imgID + imgClass + imgTitle
             + ” style=\”" + “width:” + img.width + “px; height:” + img.height + “px;” + imgStyle + “;”
             + “filter:progid:DXImageTransform.Microsoft.AlphaImageLoader”
             + “(src=\’” + img.src + “\’, sizingMethod=’scale’);\”></span>”
             img.outerHTML = strNewHTML
             j = j-1
          }
       }
    }
}
window.attachEvent(“onload”, correctPNG);
</pre>
<p>这种js先判断是否IE，然后判断ie版本，版本在6.0下则判定函数，给png的图片添加滤镜。<br />
使用起来的确方便，无论多少图片都可以解决，但是依然无法repeat。</p>
<h3>3、htc方法</h3>
<p>htc相当于完全通过插件的方法修复的IE6的bug，功能强大，支持repeat，背景等功能，使用起来也很方便。<br />
使用一个<strong>iepngfix.htc</strong> 文件，和一个透明的gif文件。</p>
<p>使用方法：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;!–[if lte IE 6]&gt;
&lt;style&gt;.png{behavior:url(“iepngfix.htc”);}&lt;/style&gt;  //在这里可以加入其他用到png图片的id或者class
&lt;script type=”text/javascript” src=”iepngfix_tilebg.js”&gt;&lt;/script&gt;
&lt;![endif]–&gt;</pre></div></div>

<p>ps：如果需要repeat背景，往往需要设置这个div 宽度为100%。</p>
<p>关于<strong>iepngfix.htc</strong>的详细用法以及<a target="_blank" href="http://www.twinhelix.com/css/iepngfix/demo/" target='_blank'>Demo</a>，请<a target="_blank" href="http://www.twinhelix.com/css/iepngfix/demo/" target='_blank'>狂点此处</a></p>
<h3>总结</h3>
<p>总结这几种方法，第三种方法（<strong>htc方法</strong>）是最简单实用，且容易推广的方法，建议可以做个公共的地址，有产品需要，只需要应用这个公共地址就行了。
<div class="copyright">
<strong>声明：</strong>文章未声明为原创文章，本文链接 <a href="http://js8.in/448.html" title="png在IE6下透明的几种方法">http://js8.in/448.html</a>. 转载请注明转自<a href="http://js8.in" title="前端开发博客"> JS8.IN ™</a></span></span></div>
<h3 class="box-title">随机文章</h3>
<ul class="box_random">
<li><a href="http://js8.in/570.html" title="十枚腾讯微博内测邀请的种子" rel="bookmark inlinks">十枚腾讯微博内测邀请的种子</a></li>
<li><a href="http://js8.in/496.html" title="WordPress博客的 SEO 技巧" rel="bookmark inlinks">WordPress博客的 SEO 技巧</a></li>
<li><a href="http://js8.in/686.html" title="IE6下javascript不能隐藏select标签的bug" rel="bookmark inlinks">IE6下javascript不能隐藏select标签的bug</a></li>
<li><a href="http://js8.in/529.html" title="通过javascript实现整站黑白效果" rel="bookmark inlinks">通过javascript实现整站黑白效果</a></li>
<li><a href="http://js8.in/711.html" title="host配置：设置电脑DNS解析文件host" rel="bookmark inlinks">host配置：设置电脑DNS解析文件host</a></li>
<li><a href="http://js8.in/472.html" title="Javascript在IE与Firefox下的差异写法总结" rel="bookmark inlinks">Javascript在IE与Firefox下的差异写法总结</a></li>
<li><a href="http://js8.in/632.html" title="网易推出LBS产品网易八方" rel="bookmark inlinks">网易推出LBS产品网易八方</a></li>
<li><a href="http://js8.in/21.html" title="网站首页做完了~i.2fool.cn" rel="bookmark inlinks">网站首页做完了~i.2fool.cn</a></li>
</ul>
<p style="margin:0;padding:0;height:1px;overflow:hidden;">
    <script type="text/javascript"><!--
        var wumiiSitePrefix = "http://js8.in";
        var wumiiEnableCustomPos = false;
        var wumiiParams = "&#038;num=4&#038;mode=3&#038;displayInFeed=1&#038;version=1.0.5.5&#038;pf=WordPress2.8.6";
    //--></script></p>
<hr />
<p><small>© 三水清 for <a href="http://js8.in">三水清</a>, 2010. |
<a href="http://js8.in/448.html#comments">2 comments</a> |在微博关注我：<a href="//weibo.com/sanshuiqing" target="_blank" title="关注断桥残雪的新浪微博">@清-三水清</a>
<br/>收藏到：
<a rel="nofollow" href="http://share.renren.com/share/buttonshare.do?link=%posturl%&title=%posttitle%" title="收藏本文到人人网" target="_blank">人人网</a> | <a rel="nofollow" href="http://www.douban.com/recommend/?url=%posturl%&title=%posttitle%" title="收藏本文到豆瓣" target="_blank">豆瓣</a> | <a rel="nofollow" href="http://www.kaixin001.com/repaste/share.php?rtitle=%posttitle%&rurl=%posturl%" title="收藏本文到开心网" target="_blank">开心网</a> | <a rel="nofollow" href="http://shuqian.qq.com/post?title=%posttitle%&%20uri=%posturl%" title="收藏本文到QQ书签" target="_blank">QQ书签</a> | <a rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=%posturl%&title=%posttitle%" title="收藏本文到新浪微博" target="_blank">新浪微博</a> | <a rel="nofollow" href="http://v.t.qq.com/share/share.php?title=%posttitle%&url=%posturl%&site=http://www.kaixin100.info" title="收藏本文到腾讯微博" target="_blank">腾讯微博</a>
<br/>
Post tags: <a href="http://js8.in/tag/css" rel="tag">css</a>, <a href="http://js8.in/tag/ie6" rel="tag">IE6</a>, <a href="http://js8.in/tag/javascript" rel="tag">javascript</a><br/>
</small></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="IE6下javascript不能隐藏select标签的bug" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F686.html&from=http%3A%2F%2Fjs8.in%2F448.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10987937.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">IE6下javascript不能隐藏select标签的bug</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="IE6 PNG图片不透明问题的解决方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F380.html&from=http%3A%2F%2Fjs8.in%2F448.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/01/2770440.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">IE6 PNG图片不透明问题的解决方法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="解决IE6 select z-index无效，遮挡div的bug" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F553.html&from=http%3A%2F%2Fjs8.in%2F448.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10987560.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">解决IE6 select z-index无效，遮挡div的bug</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="解决IE6不支持max-height的bug" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fjs8.in%2F606.html&from=http%3A%2F%2Fjs8.in%2F448.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10978851.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">解决IE6不支持max-height的bug</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://js8.in/448.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

