<?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>园子博客 &#187; Css</title>
	<atom:link href="http://www.yzznl.cn/tag/css/feed" rel="self" type="application/rss+xml" />
	<link>http://www.yzznl.cn</link>
	<description>快乐 互助 分享 一直在努力（yzznl）！</description>
	<lastBuildDate>Wed, 01 Feb 2012 03:38:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>用 CSS 实现网页的翻转效果</title>
		<link>http://www.yzznl.cn/archives/flip-page.html</link>
		<comments>http://www.yzznl.cn/archives/flip-page.html#comments</comments>
		<pubDate>Wed, 06 Apr 2011 01:39:36 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[Css]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/?p=43042</guid>
		<description><![CDATA[有时候我们需要给用户一点惊喜，一些与众不同。当你访问一个网站的时候发现网站的整个界面都是水平翻转过来的，会不会觉得是浏览器出了问题呢？其实这种网页翻转效果通过强大的 css 就可以实现滴。 本文所用的方法是来源于万戈同学的这篇文章，你只需要把以下的 CSS 加入到要实现翻转效果的网页中即可看到效果： 1 2 3 4 5 6 7 8 9 html&#123; filter:fliph &#125; body&#123; -webkit-transform: rotateY&#40;180deg&#41;; -moz-transform: skew&#40;0deg, 180deg&#41; scale&#40;-1, 1&#41;; -o-transform: skew&#40;0deg, 180deg&#41; scale&#40;-1, 1&#41;; transform: rotateY&#40;180deg&#41;; &#125; 园子博客翻转后的效果展示： 其原理是让 IE 浏览器用户用滤镜实现网页的翻转效果，非 IE 浏览器用户通过 CSS3 实现网页水平的翻转。再次感叹下 CSS 的强大魅力，我是得多学学了。 扩展阅读CSS专题之精华文章汇总 (7)Cascading Style Sheets（层叠样式表），简写为CSS，由W3C定义和维护...CSS中巧用 nowrap 属性禁止文字自动换行 (3)设计页面的时候，我们往往需要把内容在一行里面显示，也就是禁止让文字自动换行，首先来看下下面的...CSS Hack 汇总 (2)什么是 CSS [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="table转div工具：Table2CSS Converter汉化版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftable2css-converter.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fflip-page.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4290804.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">table转div工具：Table2CSS Converter汉化版下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2Fcss-skills-summary.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fflip-page.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS技巧汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F8.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fflip-page.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS入门</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="CSS 定义的50个精美按钮下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F375.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fflip-page.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/07/28/19572065.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS 定义的50个精美按钮下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F83.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fflip-page.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/07/28/19572064.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">详解CSS盒模型</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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>，会不会觉得是浏览器出了问题呢？其实这种网页翻转效果通过强大的 <span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/css" title="css">css</a></span> 就可以实现滴。<br />
<span id="more-43042"></span></p>
<p>本文所用的方法是来源于万戈同学的<a rel="nofollow" href="http://wange.im/transform-in-april-fools.html">这篇文章</a>，你只需要把以下的 CSS 加入到要实现翻转效果的网页中即可看到效果：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="css" style="font-family:Microsoft YaHei,Arial;">html<span style="color: #00AA00;">&#123;</span>
    filter<span style="color: #00AA00;">:</span>fliph
<span style="color: #00AA00;">&#125;</span>
body<span style="color: #00AA00;">&#123;</span>
    -webkit-transform<span style="color: #00AA00;">:</span> rotateY<span style="color: #00AA00;">&#40;</span>180deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
    -moz-transform<span style="color: #00AA00;">:</span> skew<span style="color: #00AA00;">&#40;</span>0deg<span style="color: #00AA00;">,</span> 180deg<span style="color: #00AA00;">&#41;</span> scale<span style="color: #00AA00;">&#40;</span>-<span style="color: #cc66cc;">1</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
    -o-transform<span style="color: #00AA00;">:</span> skew<span style="color: #00AA00;">&#40;</span>0deg<span style="color: #00AA00;">,</span> 180deg<span style="color: #00AA00;">&#41;</span> scale<span style="color: #00AA00;">&#40;</span>-<span style="color: #cc66cc;">1</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
    transform<span style="color: #00AA00;">:</span> rotateY<span style="color: #00AA00;">&#40;</span>180deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/about" title="园子" rel="nofollow">园子</a></span>博客翻转后的效果展示：</p>
<div id="attachment_43043" class="wp-caption aligncenter" style="width: 589px"><a href="http://www.yzznl.cn/archives/flip-page.html"><img src="http://www.yzznl.cn/wp-content/uploads/2011/04/flip-page.jpg" alt="园子博客翻转后的效果展示" title="园子博客翻转后的效果展示" width="579" height="331" class="size-full wp-image-43043" /></a><p class="wp-caption-text">园子博客翻转后的效果展示</p></div>
<p>其原理是让 <strong>IE 浏览器用户用滤镜实现网页的翻转效果，非 IE 浏览器用户通过 CSS3 实现网页水平的翻转</strong>。再次感叹下 <a title="CSS专题之精华文章汇总" href="http://www.yzznl.cn/archives/223.html">CSS 的强大魅力</a>，我是得多学学了。</p>
<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/223.html" title="CSS专题之精华文章汇总">CSS专题之精华文章汇总</a> (7)<br /><small>Cascading Style Sheets（层叠样式表），简写为CSS，由W3C定义和维护...</small></li><li><a href="http://www.yzznl.cn/archives/201.html" title="CSS中巧用 nowrap 属性禁止文字自动换行">CSS中巧用 nowrap 属性禁止文字自动换行</a> (3)<br /><small>设计页面的时候，我们往往需要把内容在一行里面显示，也就是禁止让文字自动换行，首先来看下下面的...</small></li><li><a href="http://www.yzznl.cn/archives/200.html" title="CSS Hack 汇总">CSS Hack 汇总</a> (2)<br /><small>什么是 CSS Hack ？

由于不同的浏览器，比如 IE6.0，IE7.0，IE8....</small></li><li><a href="http://www.yzznl.cn/archives/108.html" title="id与class的使用原则">id与class的使用原则</a> (3)<br /><small>在前面的文章里园子主要与大家分享了CSS的入门知识以及CSS技巧汇总。在用CSS来控制网页布...</small></li><li><a href="http://www.yzznl.cn/archives/81.html" title="CSS入门知识">CSS入门知识</a> (1)<br /><small>我们首先要了解下面几点关于CSS方面的必备常识：


	CSS是Cascading S...</small></li><li><a href="http://www.yzznl.cn/archives/74.html" title="如何优化CSS文件">如何优化CSS文件</a> (4)<br /><small>尽管现在的网络质量日新月异的发展着，但做为网页设计者还是非常在意网站的交互速度。我们都知道，...</small></li><li><a href="http://www.yzznl.cn/archives/73.html" title="用CSS做的几个漂亮按钮">用CSS做的几个漂亮按钮</a> (0)<br /><small>你是否发现有些网站制作的按钮非常漂亮，而且还不是使用PS做的图片，这是怎么做到的呢？今天园子...</small></li><li><a href="http://www.yzznl.cn/archives/36.html" title="CSS布局命名规则">CSS布局命名规则</a> (1)<br /><small>近半年来园子一直试着遵循<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="WEB标准">WEB标准</a></span>设计和制作网页，今天花些时间整理一下在布局过程中会频繁用到...</small></li><li><a href="http://www.yzznl.cn/archives/10.html" title="常用的CSS单位">常用的CSS单位</a> (0)<br /><small>国内大多数站点都采用px作为字体的单位，当然也包括园子的网站。而国外的一些主流英文站点，几乎...</small></li><li><a href="http://www.yzznl.cn/archives/9.html" title="css语法结构">css语法结构</a> (0)<br /><small>css的语法结构由三部分组成：选择符（Selector）、属性（property）、和值（v...</small></li></ul><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="table转div工具：Table2CSS Converter汉化版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftable2css-converter.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fflip-page.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4290804.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">table转div工具：Table2CSS Converter汉化版下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2Fcss-skills-summary.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fflip-page.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS技巧汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F8.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fflip-page.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS入门</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="CSS 定义的50个精美按钮下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F375.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fflip-page.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/07/28/19572065.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS 定义的50个精美按钮下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F83.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fflip-page.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/07/28/19572064.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">详解CSS盒模型</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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://www.yzznl.cn/archives/flip-page.html/feed</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>CSS专题之精华文章汇总</title>
		<link>http://www.yzznl.cn/archives/223.html</link>
		<comments>http://www.yzznl.cn/archives/223.html#comments</comments>
		<pubDate>Sun, 31 May 2009 07:32:13 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[Css]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/?p=40902</guid>
		<description><![CDATA[Cascading Style Sheets（层叠样式表），简写为css，由W3C定义和维护的标准，一种用来为结构化文档（如HTML文档或XML应用）添加样式（字体、间距和颜色等）的计算机语言。您想过吗？您仅仅改变一个文件就可以改变数百个网页的外观，用传统的方法实现这个功能的繁琐程度可想而知，但只要你学会了CSS，这些个性化的表现方式实现起来就如喝杯茶那么简单！这个专题园子将总结在学习CSS的过程中遇到的一些问题和解决方法，这是一个从入门到精通循序渐进的过程，园子希望这些文章可以帮助到您，让我们一起开始学习吧！ CSS入门知识 CSS入门 调用样式表的方法 详解CSS盒模型 css语法结构 id与class的使用原则 常用的CSS单位 CSS布局命名规则 CSS技巧汇总 如何优化CSS文件 CSS中巧用 nowrap 属性禁止文字自动换行 PS：本来这是一个页面，现在改为文章列表，由此引起的不便请各位朋友多多包涵。 扩展阅读用 CSS 实现网页的翻转效果 (38)有时候我们需要给用户一点惊喜，一些与众不同。当你访问一个网站的时候发现网站的整个界面都是水平...CSS中巧用 nowrap 属性禁止文字自动换行 (3)设计页面的时候，我们往往需要把内容在一行里面显示，也就是禁止让文字自动换行，首先来看下下面的...CSS Hack 汇总 (2)什么是 CSS Hack ？ 由于不同的浏览器，比如 IE6.0，IE7.0，IE8....id与class的使用原则 (3)在前面的文章里园子主要与大家分享了CSS的入门知识以及CSS技巧汇总。在用CSS来控制网页布...CSS入门知识 (1)我们首先要了解下面几点关于CSS方面的必备常识： CSS是Cascading S...如何优化CSS文件 (4)尽管现在的网络质量日新月异的发展着，但做为网页设计者还是非常在意网站的交互速度。我们都知道，...用CSS做的几个漂亮按钮 (0)你是否发现有些网站制作的按钮非常漂亮，而且还不是使用PS做的图片，这是怎么做到的呢？今天园子...CSS布局命名规则 (1)近半年来园子一直试着遵循WEB标准设计和制作网页，今天花些时间整理一下在布局过程中会频繁用到...常用的CSS单位 (0)国内大多数站点都采用px作为字体的单位，当然也包括园子的网站。而国外的一些主流英文站点，几乎...css语法结构 (0)css的语法结构由三部分组成：选择符（Selector）、属性（property）、和值（v...<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" 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%2Fwww.yzznl.cn%2Farchives%2Fcss-skills-summary.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F223.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS技巧汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="table转div工具：Table2CSS Converter汉化版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftable2css-converter.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F223.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4290804.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">table转div工具：Table2CSS Converter汉化版下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="CSS Hack 汇总" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F200.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F223.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS Hack 汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="WEB标准专题之精华文章汇总" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F222.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F223.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WEB标准专题之精华文章汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="SEO专题精华文章汇总" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F255.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F223.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">SEO专题精华文章汇总</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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>Cascading Style Sheets（层叠样式表），简写为<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/css" title="css">css</a></span>，由W3C定义和维护的标准，一种用来为结构化文档（如HTML文档或XML应用）添加样式（字体、间距和颜色等）的计算机语言。您想过吗？您仅仅改变一个文件就可以改变数百个网页的外观，用传统的方法实现这个功能的繁琐程度可想而知，但只要你学会了CSS，这些个性化的表现方式实现起来就如喝杯茶那么简单！这个专题<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/about" title="园子" rel="nofollow">园子</a></span>将总结在学习CSS的过程中遇到的一些问题和解决方法，这是一个从入门到精通循序渐进的过程，园子希望这些文章可以帮助到您，让我们一起开始学习吧！</p>
<ul>
<li><a title="CSS入门知识" href="http://www.yzznl.cn/archives/81.html">CSS入门知识</a></li>
<li><a title="CSS入门" href="http://www.yzznl.cn/archives/8.html">CSS入门</a></li>
<li><a title="调用样式表的方法" href="http://www.yzznl.cn/archives/5.html">调用样式表的方法</a></li>
<li><a title="详解CSS盒模型" href="http://www.yzznl.cn/archives/83.html">详解CSS盒模型</a></li>
<li><a title="css语法结构" href="http://www.yzznl.cn/archives/9.html">css语法结构</a></li>
<li><a title="id与class的使用原则" href="http://www.yzznl.cn/archives/108.html">id与class的使用原则</a></li>
<li><a title="常用的CSS单位" href="http://www.yzznl.cn/archives/10.html">常用的CSS单位</a></li>
<li><a title="CSS布局命名规则" href="http://www.yzznl.cn/archives/36.html">CSS布局命名规则</a></li>
<li><a title="CSS技巧汇总" href="http://www.yzznl.cn/archives/css-skills-summary.html">CSS技巧汇总</a></li>
<li><a title="如何优化CSS文件" href="http://www.yzznl.cn/archives/74.html">如何优化CSS文件</a></li>
<li><a title="CSS中巧用 nowrap 属性禁止文字自动换行" href="http://www.yzznl.cn/archives/201.html">CSS中巧用 nowrap 属性禁止文字自动换行</a></li>
</ul>
<p>PS：本来这是一个页面，现在改为文章列表，由此引起的不便请各位朋友多多包涵。 <img src='http://www.yzznl.cn/wp-includes/images/smilies/icon_neutral.gif' alt=':neutral:' class='wp-smiley' /> </p>
<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/flip-page.html" title="用 CSS 实现网页的翻转效果">用 CSS 实现网页的翻转效果</a> (38)<br /><small>有时候我们需要给用户一点惊喜，一些与众不同。当你访问一个网站的时候发现网站的整个界面都是水平...</small></li><li><a href="http://www.yzznl.cn/archives/201.html" title="CSS中巧用 nowrap 属性禁止文字自动换行">CSS中巧用 nowrap 属性禁止文字自动换行</a> (3)<br /><small>设计页面的时候，我们往往需要把内容在一行里面显示，也就是禁止让文字自动换行，首先来看下下面的...</small></li><li><a href="http://www.yzznl.cn/archives/200.html" title="CSS Hack 汇总">CSS Hack 汇总</a> (2)<br /><small>什么是 CSS Hack ？

由于不同的浏览器，比如 IE6.0，IE7.0，IE8....</small></li><li><a href="http://www.yzznl.cn/archives/108.html" title="id与class的使用原则">id与class的使用原则</a> (3)<br /><small>在前面的文章里园子主要与大家分享了CSS的入门知识以及CSS技巧汇总。在用CSS来控制网页布...</small></li><li><a href="http://www.yzznl.cn/archives/81.html" title="CSS入门知识">CSS入门知识</a> (1)<br /><small>我们首先要了解下面几点关于CSS方面的必备常识：


	CSS是Cascading S...</small></li><li><a href="http://www.yzznl.cn/archives/74.html" title="如何优化CSS文件">如何优化CSS文件</a> (4)<br /><small>尽管现在的网络质量日新月异的发展着，但做为网页设计者还是非常在意网站的交互速度。我们都知道，...</small></li><li><a href="http://www.yzznl.cn/archives/73.html" title="用CSS做的几个漂亮按钮">用CSS做的几个漂亮按钮</a> (0)<br /><small>你是否发现有些网站制作的按钮非常漂亮，而且还不是使用PS做的图片，这是怎么做到的呢？今天园子...</small></li><li><a href="http://www.yzznl.cn/archives/36.html" title="CSS布局命名规则">CSS布局命名规则</a> (1)<br /><small>近半年来园子一直试着遵循<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="WEB标准">WEB标准</a></span>设计和制作网页，今天花些时间整理一下在布局过程中会频繁用到...</small></li><li><a href="http://www.yzznl.cn/archives/10.html" title="常用的CSS单位">常用的CSS单位</a> (0)<br /><small>国内大多数站点都采用px作为字体的单位，当然也包括园子的网站。而国外的一些主流英文站点，几乎...</small></li><li><a href="http://www.yzznl.cn/archives/9.html" title="css语法结构">css语法结构</a> (0)<br /><small>css的语法结构由三部分组成：选择符（Selector）、属性（property）、和值（v...</small></li></ul><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" 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%2Fwww.yzznl.cn%2Farchives%2Fcss-skills-summary.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F223.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS技巧汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="table转div工具：Table2CSS Converter汉化版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftable2css-converter.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F223.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4290804.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">table转div工具：Table2CSS Converter汉化版下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="CSS Hack 汇总" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F200.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F223.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS Hack 汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="WEB标准专题之精华文章汇总" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F222.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F223.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WEB标准专题之精华文章汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="SEO专题精华文章汇总" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F255.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F223.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">SEO专题精华文章汇总</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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://www.yzznl.cn/archives/223.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>CSS中巧用 nowrap 属性禁止文字自动换行</title>
		<link>http://www.yzznl.cn/archives/201.html</link>
		<comments>http://www.yzznl.cn/archives/201.html#comments</comments>
		<pubDate>Sat, 09 May 2009 03:43:11 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[Css]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/?p=40149</guid>
		<description><![CDATA[设计页面的时候，我们往往需要把内容在一行里面显示，也就是禁止让文字自动换行，首先来看下下面的图片： 我们可以看到在没有定义 white-space: nowrap; 属性的时候，链接文字会自动换行，而这些效果并不是我们想要的。以上的例子是在做友情链接的时候采用了 li 左浮动所出现的问题（因为每个链接的字数无法确定，所以无法定义 li 的固定宽度）。解决方法也很简单，只要在 li 属性里面加上 white-space: nowrap; 声明就可以了。 语法： white-space : normal &#124; pre &#124; nowrap 参数： normal : 默认处理方式 pre : 用等宽字体显示预先格式化的文本。不合并字间的空白距离和进行两端对齐。 nowrap : 强制在同一行内显示所有文本，直到文本结束或者遭遇br对象。 说明： 通过设置 white-space属性可以改变对象内空格的处理方式。 应用示例： p &#123; white-space: nowrap; &#125; 扩展阅读用 CSS 实现网页的翻转效果 (38)有时候我们需要给用户一点惊喜，一些与众不同。当你访问一个网站的时候发现网站的整个界面都是水平...CSS专题之精华文章汇总 (7)Cascading Style Sheets（层叠样式表），简写为css，由W3C定义和维护...CSS Hack 汇总 (2)什么是 CSS Hack ？ 由于不同的浏览器，比如 [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="table转div工具：Table2CSS Converter汉化版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftable2css-converter.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F201.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4290804.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">table转div工具：Table2CSS Converter汉化版下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2Fcss-skills-summary.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F201.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS技巧汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F83.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F201.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/07/28/19572064.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">详解CSS盒模型</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="CSS 定义的50个精美按钮下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F375.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F201.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/07/28/19572065.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS 定义的50个精美按钮下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2Fflip-page.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F201.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/04/06/5103756.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">用 CSS 实现网页的翻转效果</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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[<div class="mceTemp">设计页面的时候，我们往往需要把内容在一行里面显示，也就是禁止让文字自动换行，首先来看下下面的图片：</div>
<p><a href="http://www.yzznl.cn/archives/201.html"><img class="size-full wp-image-40150" title="没有使用 nowrap 属性时文字自动换行效果" src="http://www.yzznl.cn/wp-content/uploads/2009/05/text_img.gif" alt="没有使用 nowrap 属性时文字自动换行效果" width="227" height="90" /></a><br />
<span id="more-40149"></span></p>
<p>我们可以看到在没有定义<strong> white-space: nowrap;</strong> 属性的时候，链接文字会自动换行，而这些效果并不是我们想要的。以上的例子是在做友情链接的时候采用了 li 左浮动所出现的问题（因为每个链接的字数无法确定，所以无法定义 li 的固定宽度）。解决方法也很简单，只要在 li 属性里面加上<strong> white-space: nowrap;</strong> 声明就可以了。</p>
<p><strong>语法：</strong></p>
<p>white-space : normal | pre | nowrap</p>
<p><strong>参数：</strong></p>
<p>normal : 默认处理方式</p>
<p>pre : 用等宽字体显示预先格式化的文本。不合并字间的空白距离和进行两端对齐。</p>
<p>nowrap : 强制在同一行内显示所有文本，直到文本结束或者遭遇br对象。</p>
<p><strong>说明：</strong></p>
<p>通过设置 white-space属性可以改变对象内空格的处理方式。</p>
<p><strong>应用示例：</strong></p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:Microsoft YaHei,Arial;">p <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;">nowrap</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/flip-page.html" title="用 CSS 实现网页的翻转效果">用 CSS 实现网页的翻转效果</a> (38)<br /><small>有时候我们需要给用户一点惊喜，一些与众不同。当你访问一个网站的时候发现网站的整个界面都是水平...</small></li><li><a href="http://www.yzznl.cn/archives/223.html" title="CSS专题之精华文章汇总">CSS专题之精华文章汇总</a> (7)<br /><small>Cascading Style Sheets（层叠样式表），简写为<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/css" title="css">css</a></span>，由W3C定义和维护...</small></li><li><a href="http://www.yzznl.cn/archives/200.html" title="CSS Hack 汇总">CSS Hack 汇总</a> (2)<br /><small>什么是 CSS Hack ？

由于不同的浏览器，比如 IE6.0，IE7.0，IE8....</small></li><li><a href="http://www.yzznl.cn/archives/108.html" title="id与class的使用原则">id与class的使用原则</a> (3)<br /><small>在前面的文章里<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/about" title="园子" rel="nofollow">园子</a></span>主要与大家分享了CSS的入门知识以及CSS技巧汇总。在用CSS来控制网页布...</small></li><li><a href="http://www.yzznl.cn/archives/81.html" title="CSS入门知识">CSS入门知识</a> (1)<br /><small>我们首先要了解下面几点关于CSS方面的必备常识：


	CSS是Cascading S...</small></li><li><a href="http://www.yzznl.cn/archives/74.html" title="如何优化CSS文件">如何优化CSS文件</a> (4)<br /><small>尽管现在的网络质量日新月异的发展着，但做为网页设计者还是非常在意网站的交互速度。我们都知道，...</small></li><li><a href="http://www.yzznl.cn/archives/73.html" title="用CSS做的几个漂亮按钮">用CSS做的几个漂亮按钮</a> (0)<br /><small>你是否发现有些网站制作的按钮非常漂亮，而且还不是使用PS做的图片，这是怎么做到的呢？今天园子...</small></li><li><a href="http://www.yzznl.cn/archives/36.html" title="CSS布局命名规则">CSS布局命名规则</a> (1)<br /><small>近半年来园子一直试着遵循<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="WEB标准">WEB标准</a></span>设计和制作网页，今天花些时间整理一下在布局过程中会频繁用到...</small></li><li><a href="http://www.yzznl.cn/archives/10.html" title="常用的CSS单位">常用的CSS单位</a> (0)<br /><small>国内大多数站点都采用px作为字体的单位，当然也包括园子的网站。而国外的一些主流英文站点，几乎...</small></li><li><a href="http://www.yzznl.cn/archives/9.html" title="css语法结构">css语法结构</a> (0)<br /><small>css的语法结构由三部分组成：选择符（Selector）、属性（property）、和值（v...</small></li></ul><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="table转div工具：Table2CSS Converter汉化版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftable2css-converter.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F201.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4290804.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">table转div工具：Table2CSS Converter汉化版下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2Fcss-skills-summary.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F201.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS技巧汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F83.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F201.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/07/28/19572064.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">详解CSS盒模型</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="CSS 定义的50个精美按钮下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F375.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F201.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/07/28/19572065.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS 定义的50个精美按钮下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2Fflip-page.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F201.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/04/06/5103756.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">用 CSS 实现网页的翻转效果</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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://www.yzznl.cn/archives/201.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSS Hack 汇总</title>
		<link>http://www.yzznl.cn/archives/200.html</link>
		<comments>http://www.yzznl.cn/archives/200.html#comments</comments>
		<pubDate>Fri, 08 May 2009 03:33:31 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[Css]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/?p=40126</guid>
		<description><![CDATA[什么是 css Hack ？ 由于不同的浏览器，比如 IE6.0，IE7.0，IE8.0,Firefox 等，对 CSS 的解析认识不一样，因此会导致生成的页面效果不一样，得不到我们所需要的页面效果。这个时候我们就需要针对不同的浏览器去写不同的CSS，让它能够同时兼容不同的浏览器，能在不同的浏览器中也能得到我们想要的页面效果。这个针对不同的浏览器写不同的 CSS 代码的的过程，就叫 CSS Hack 。 由于要照顾到不同的浏览器下保持完美的显示效果，经常用到 CSS Hack，园子把常用的一些做了一下汇总，希望能够帮助到朋友们。 区别于IE6、IE7、Firefox 的 CSS Hack 1 2 3 .box &#123;margin-top:5px;&#125; /*Firefox */ * html .box &#123;margin-top:10px;&#125; /*IE6*/ *+html .box &#123;margin-top:15px;&#125; /*IE7*/ 通过上述 CSS Hack 可以实现在 Firefox 中上边距为5px, IE6 中上边距为10px, IE7 上边距为15px。 屏蔽IE浏览器（也就是IE下不显示） 1 2 *:lang&#40;zh&#41; select &#123;font:12px !important;&#125; /*FF可见*/ [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" 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%2Fwww.yzznl.cn%2Farchives%2Fcss-skills-summary.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F200.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS技巧汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="table转div工具：Table2CSS Converter汉化版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftable2css-converter.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F200.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4290804.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">table转div工具：Table2CSS Converter汉化版下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F223.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F200.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS专题之精华文章汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F8.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F200.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS入门</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="CSS 定义的50个精美按钮下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F375.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F200.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/07/28/19572065.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS 定义的50个精美按钮下载</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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>什么是 <span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/css" title="css">css</a></span> Hack ？</strong></p>
<p>由于不同的浏览器，比如 IE6.0，IE7.0，IE8.0,Firefox 等，对 CSS 的解析认识不一样，因此会导致生成的页面效果不一样，得不到我们所需要的页面效果。这个时候我们就需要针对不同的浏览器去写不同的CSS，让它能够同时兼容不同的浏览器，能在不同的浏览器中也能得到我们想要的页面效果。这个针对不同的浏览器写不同的 CSS 代码的的过程，就叫 <strong>CSS Hack </strong>。</p>
<p>由于要照顾到不同的浏览器下保持完美的显示效果，经常用到 CSS Hack，<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/about" title="园子" rel="nofollow">园子</a></span>把常用的一些做了一下汇总，希望能够帮助到朋友们。<br />
<span id="more-40126"></span></p>
<h4>区别于IE6、IE7、Firefox 的 CSS Hack</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:Microsoft YaHei,Arial;"><span style="color: #6666ff;">.box</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span> <span style="color: #808080; font-style: italic;">/*Firefox */</span>
<span style="color: #00AA00;">*</span> html <span style="color: #6666ff;">.box</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span> <span style="color: #808080; font-style: italic;">/*IE6*/</span>
<span style="color: #00AA00;">*+</span>html <span style="color: #6666ff;">.box</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">15px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span> <span style="color: #808080; font-style: italic;">/*IE7*/</span></pre></td></tr></table></div>

<p>通过上述 CSS Hack 可以实现在 Firefox 中上边距为5px, IE6 中上边距为10px, IE7 上边距为15px。</p>
<h4>屏蔽IE浏览器（也就是IE下不显示）</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:Microsoft YaHei,Arial;"><span style="color: #00AA00;">*:</span>lang<span style="color: #00AA00;">&#40;</span>zh<span style="color: #00AA00;">&#41;</span> select <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span>  !important<span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span> <span style="color: #808080; font-style: italic;">/*FF可见*/</span>
select<span style="color: #3333ff;">:empty </span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span>  !important<span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span> <span style="color: #808080; font-style: italic;">/*safari可见*/</span></pre></td></tr></table></div>

<p>这里select是选择符，根据情况更换。第二句是MAC上safari浏览器独有的。</p>
<h4>IE6及IE6以下识别</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:Microsoft YaHei,Arial;"><span style="color: #00AA00;">*</span> html  select <span style="color: #00AA00;">&#123;</span>…<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>这个地方要特别注意很多博客都写成了是IE6的HACK其实IE5.x同样可以识别这个HACK。其它浏览器不识别。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:Microsoft YaHei,Arial;">html<span style="color: #808080; font-style: italic;">/**/</span> <span style="color: #00AA00;">&gt;</span>body  select <span style="color: #00AA00;">&#123;</span>…<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>这句与上一句的作用相同。</p>
<h4>仅IE6不识别，屏蔽IE6</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:Microsoft YaHei,Arial;">select <span style="color: #00AA00;">&#123;</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;">/*屏蔽IE6*/</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>这里主要是通过CSS注释分开一个属性与值，注释在冒号前。</p>
<h4>仅IE7与IE5.0可以识别</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:Microsoft YaHei,Arial;"><span style="color: #00AA00;">*+</span>html  select <span style="color: #00AA00;">&#123;</span>…<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>当面临需要只针对IE7与IE5.0做样式的时候就可以采用这个HACK。</p>
<h4>仅IE7可以识别</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:Microsoft YaHei,Arial;"><span style="color: #00AA00;">*+</span>html  select <span style="color: #00AA00;">&#123;</span>…!important<span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>当面临需要只针对IE7做样式的时候就可以采用这个HACK。</p>
<h4>仅IE6与IE5不识别，屏蔽IE6与IE5</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:Microsoft YaHei,Arial;">select<span style="color: #808080; font-style: italic;">/**/</span> <span style="color: #00AA00;">&#123;</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: #00AA00;">&#125;</span> <span style="color: #808080; font-style: italic;">/*IE6,IE5不识别*/</span></pre></td></tr></table></div>

<p>这里与上面一句不同的是在选择符与花括号之间多了一个CSS注释。<strong>不屏蔽IE5.5 。</strong></p>
<h4>仅IE5不识别，屏蔽IE5</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:Microsoft YaHei,Arial;">select <span style="color: #00AA00;">&#123;</span>…<span style="color: #00AA00;">&#125;</span> <span style="color: #808080; font-style: italic;">/*IE5不识别*/</span></pre></td></tr></table></div>

<p>这一句是在上一句中去掉了属性区的注释。只有IE5不识别，IE5.5可以识别。	</p>
<h4>盒模型解决方法</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:Microsoft YaHei,Arial;">selct <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #3333ff;">:IE5</span>.x宽度<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">voice-family</span> <span style="color: #00AA00;">:</span>”\”<span style="color: #00AA00;">&#125;</span>\”<span style="color: #ff0000;">&quot;; voice-family:inherit; width:正确宽度;}</span></pre></td></tr></table></div>

<p>盒模型的清除方法不是通过!important来处理的。这点要明确。	</p>
<h4>只有Opera识别</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:Microsoft YaHei,Arial;"><span style="color: #a1a100;">@media all and (min-width: 0px){ select {……} }</span></pre></td></tr></table></div>

<p>针对Opera浏览器做单独的设定。	</p>
<h4>IE的if条件Hack</h4>
<pre>
<!–[if IE]> Only IE <![endif]–>
所有的IE可识别
<!–[if IE 5.0]> Only IE 5.0 <![endif]–>
只有IE5.0可以识别
<!–[if gt IE 5.0]> Only IE 5.0+ <![endif]–>
IE5.0包换IE5.5都可以识别
<!–[if lt IE 6]> Only IE 6- <![endif]–>
仅IE6可识别
<!–[if gte IE 6]> Only IE 6/+ <![endif]–>
IE6以及IE6以下的IE5.x都可识别
<!–[if lte IE 7]> Only IE 7/- <![endif]–>
仅IE7可识别
</pre>
<h4>清除浮动</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:Microsoft YaHei,Arial;">select<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: #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;">height</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</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: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>在Firefox中，当子级都为浮动时，那么父级的高度就无法完全的包住整个子级，那么这时用这个清除浮动的HACK来对父级做一次定义，那么就可以解决这个问题。	</p>
<h4>截字省略号</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:Microsoft YaHei,Arial;">select <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;">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;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>这个是在越出长度后会自行的截掉多出部分的文字，并以省略号结尾，很好的一个技术。只是目前Firefox并不支持。</p>
<p>扩展阅读：</p>
<p><a href="http://www.happinesz.cn/archives/1331/">说说CSS Hack 和向后兼容</a></p>
<p>您也可以查看更多的关于<a title="CSS技巧汇总 " href="http://www.yzznl.cn/archives/css-skills-summary.html">CSS技巧汇总</a>。</p>
<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/flip-page.html" title="用 CSS 实现网页的翻转效果">用 CSS 实现网页的翻转效果</a> (38)<br /><small>有时候我们需要给用户一点惊喜，一些与众不同。当你访问一个网站的时候发现网站的整个界面都是水平...</small></li><li><a href="http://www.yzznl.cn/archives/223.html" title="CSS专题之精华文章汇总">CSS专题之精华文章汇总</a> (7)<br /><small>Cascading Style Sheets（层叠样式表），简写为CSS，由W3C定义和维护...</small></li><li><a href="http://www.yzznl.cn/archives/201.html" title="CSS中巧用 nowrap 属性禁止文字自动换行">CSS中巧用 nowrap 属性禁止文字自动换行</a> (3)<br /><small>设计页面的时候，我们往往需要把内容在一行里面显示，也就是禁止让文字自动换行，首先来看下下面的...</small></li><li><a href="http://www.yzznl.cn/archives/108.html" title="id与class的使用原则">id与class的使用原则</a> (3)<br /><small>在前面的文章里园子主要与大家分享了CSS的入门知识以及CSS技巧汇总。在用CSS来控制网页布...</small></li><li><a href="http://www.yzznl.cn/archives/81.html" title="CSS入门知识">CSS入门知识</a> (1)<br /><small>我们首先要了解下面几点关于CSS方面的必备常识：


	CSS是Cascading S...</small></li><li><a href="http://www.yzznl.cn/archives/74.html" title="如何优化CSS文件">如何优化CSS文件</a> (4)<br /><small>尽管现在的网络质量日新月异的发展着，但做为网页设计者还是非常在意网站的交互速度。我们都知道，...</small></li><li><a href="http://www.yzznl.cn/archives/73.html" title="用CSS做的几个漂亮按钮">用CSS做的几个漂亮按钮</a> (0)<br /><small>你是否发现有些网站制作的按钮非常漂亮，而且还不是使用PS做的图片，这是怎么做到的呢？今天园子...</small></li><li><a href="http://www.yzznl.cn/archives/36.html" title="CSS布局命名规则">CSS布局命名规则</a> (1)<br /><small>近半年来园子一直试着遵循<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="WEB标准">WEB标准</a></span>设计和制作网页，今天花些时间整理一下在布局过程中会频繁用到...</small></li><li><a href="http://www.yzznl.cn/archives/10.html" title="常用的CSS单位">常用的CSS单位</a> (0)<br /><small>国内大多数站点都采用px作为字体的单位，当然也包括园子的网站。而国外的一些主流英文站点，几乎...</small></li><li><a href="http://www.yzznl.cn/archives/9.html" title="css语法结构">css语法结构</a> (0)<br /><small>css的语法结构由三部分组成：选择符（Selector）、属性（property）、和值（v...</small></li></ul><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" 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%2Fwww.yzznl.cn%2Farchives%2Fcss-skills-summary.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F200.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS技巧汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="table转div工具：Table2CSS Converter汉化版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftable2css-converter.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F200.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4290804.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">table转div工具：Table2CSS Converter汉化版下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F223.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F200.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS专题之精华文章汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F8.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F200.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS入门</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="CSS 定义的50个精美按钮下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F375.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F200.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/07/28/19572065.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS 定义的50个精美按钮下载</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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://www.yzznl.cn/archives/200.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>id与class的使用原则</title>
		<link>http://www.yzznl.cn/archives/108.html</link>
		<comments>http://www.yzznl.cn/archives/108.html#comments</comments>
		<pubDate>Tue, 24 Mar 2009 03:03:44 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[Css]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/?p=36918</guid>
		<description><![CDATA[在前面的文章里园子主要与大家分享了CSS的入门知识以及CSS技巧汇总。在用css来控制网页布局时我们可能都会遇到一个问题：当定义一个属性时，是使用id，还是使用class？今天园子就把自己平时做站时的经验给大家简要讲述一下，希望能够对您有所帮助。 id的使用原则 先来说说id，id具有唯一性，其使用原则也是依据这一特性建立的。id是不能重复的，所以在xhtml的结构中，大结构一定是用id。比如标志、导航、主体内容、版权。这些根据制定的规范命名为#logo , #nav , #content , #copyright 等等，本着其唯一性的原则园子建议定义id尽量在外围使用。 class的使用原则 class在CSS的定义中具有普遍性。说白一点就是class具有可重复无限制的使用多次，园子建议大家尽量在结构内部使用。这样做的好处是有利于网站代码的后期维护与修改，这样的做法就会让所有的class都成为id的子级或是孙级。在我们写CSS的时候可以写成这样 #father .child  {…}，另外需要注意的是尽量不要让class包含id，比如.father #child  {…}如果写成这样很显然就非常不可取。当然这也只是相对于良好书写习惯的一些建议，仅供大家参考。 综上所述，归总起来一句话：id是唯一的并且是父级的，class是可以重复的并且是子级的。保持一个良好的代码书写习惯对于以后的代码维护会有很大的帮助，如果您有更好的建议，欢迎给我留言探讨。 扩展阅读用 CSS 实现网页的翻转效果 (38)有时候我们需要给用户一点惊喜，一些与众不同。当你访问一个网站的时候发现网站的整个界面都是水平...CSS专题之精华文章汇总 (7)Cascading Style Sheets（层叠样式表），简写为CSS，由W3C定义和维护...CSS中巧用 nowrap 属性禁止文字自动换行 (3)设计页面的时候，我们往往需要把内容在一行里面显示，也就是禁止让文字自动换行，首先来看下下面的...CSS Hack 汇总 (2)什么是 CSS Hack ？ 由于不同的浏览器，比如 IE6.0，IE7.0，IE8....CSS入门知识 (1)我们首先要了解下面几点关于CSS方面的必备常识： CSS是Cascading S...如何优化CSS文件 (4)尽管现在的网络质量日新月异的发展着，但做为网页设计者还是非常在意网站的交互速度。我们都知道，...用CSS做的几个漂亮按钮 (0)你是否发现有些网站制作的按钮非常漂亮，而且还不是使用PS做的图片，这是怎么做到的呢？今天园子...CSS布局命名规则 (1)近半年来园子一直试着遵循WEB标准设计和制作网页，今天花些时间整理一下在布局过程中会频繁用到...常用的CSS单位 (0)国内大多数站点都采用px作为字体的单位，当然也包括园子的网站。而国外的一些主流英文站点，几乎...css语法结构 (0)css的语法结构由三部分组成：选择符（Selector）、属性（property）、和值（v...<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="h1~h6的使用原则" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F67.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F108.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">h1~h6的使用原则</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="网站布局设计原则" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F17.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F108.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">网站布局设计原则</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="Photoshop CS4 简体中文绿色版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F169.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F108.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4290032.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Photoshop CS4 简体中文绿色版下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="PC 端二维码编码软件推荐：元泰QRCode" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F397.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F108.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4292014.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">PC 端二维码编码软件推荐：元泰QRCode</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="使用 Photo Funia 在线生成高品质非主流图片" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F321.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F108.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4292496.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用 Photo Funia 在线生成高品质非主流图片</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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>在前面的文章里<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/about" title="园子" rel="nofollow">园子</a></span>主要与大家分享了<a title="CSS的入门知识" href="http://www.yzznl.cn/archives/8.html">CSS的入门知识</a>以及<a title="CSS技巧汇总" href="http://www.yzznl.cn/archives/css-skills-summary.html">CSS技巧汇总</a>。在用<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/css" title="css">css</a></span>来控制网页布局时我们可能都会遇到一个问题：当定义一个属性时，是使用id，还是使用class？今天园子就把自己平时做站时的经验给大家简要讲述一下，希望能够对您有所帮助。<br />
<span id="more-36918"></span></p>
<p><strong>id的使用原则</strong></p>
<p>先来说说id，id具有<strong>唯一性</strong>，其使用原则也是依据这一特性建立的。id是不能重复的，所以在<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/xhtml" title="xhtml">xhtml</a></span>的结构中，大结构一定是用id。比如标志、导航、主体内容、版权。这些根据制定的规范命名为#logo , #nav , #content , #copyright 等等，本着其唯一性的原则园子建议定义id尽量在外围使用。</p>
<p><strong>class的使用原则<br />
</strong>class在CSS的定义中具有<strong>普遍性</strong>。说白一点就是class具有可重复无限制的使用多次，园子建议大家尽量在结构内部使用。这样做的好处是有利于网站代码的后期维护与修改，这样的做法就会让所有的class都成为id的子级或是孙级。在我们写CSS的时候可以写成这样 #father .child  {…}，另外需要注意的是尽量不要让class包含id，比如.father #child  {…}如果写成这样很显然就非常不可取。当然这也只是相对于良好书写习惯的一些建议，仅供大家参考。</p>
<p>综上所述，归总起来一句话：<strong>id是唯一的并且是父级的，class是可以重复的并且是子级的</strong>。保持一个良好的代码书写习惯对于以后的代码维护会有很大的帮助，如果您有更好的建议，欢迎给我留言探讨。</p>
<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/flip-page.html" title="用 CSS 实现网页的翻转效果">用 CSS 实现网页的翻转效果</a> (38)<br /><small>有时候我们需要给用户一点惊喜，一些与众不同。当你访问一个网站的时候发现网站的整个界面都是水平...</small></li><li><a href="http://www.yzznl.cn/archives/223.html" title="CSS专题之精华文章汇总">CSS专题之精华文章汇总</a> (7)<br /><small>Cascading Style Sheets（层叠样式表），简写为CSS，由W3C定义和维护...</small></li><li><a href="http://www.yzznl.cn/archives/201.html" title="CSS中巧用 nowrap 属性禁止文字自动换行">CSS中巧用 nowrap 属性禁止文字自动换行</a> (3)<br /><small>设计页面的时候，我们往往需要把内容在一行里面显示，也就是禁止让文字自动换行，首先来看下下面的...</small></li><li><a href="http://www.yzznl.cn/archives/200.html" title="CSS Hack 汇总">CSS Hack 汇总</a> (2)<br /><small>什么是 CSS Hack ？

由于不同的浏览器，比如 IE6.0，IE7.0，IE8....</small></li><li><a href="http://www.yzznl.cn/archives/81.html" title="CSS入门知识">CSS入门知识</a> (1)<br /><small>我们首先要了解下面几点关于CSS方面的必备常识：


	CSS是Cascading S...</small></li><li><a href="http://www.yzznl.cn/archives/74.html" title="如何优化CSS文件">如何优化CSS文件</a> (4)<br /><small>尽管现在的网络质量日新月异的发展着，但做为网页设计者还是非常在意网站的交互速度。我们都知道，...</small></li><li><a href="http://www.yzznl.cn/archives/73.html" title="用CSS做的几个漂亮按钮">用CSS做的几个漂亮按钮</a> (0)<br /><small>你是否发现有些网站制作的按钮非常漂亮，而且还不是使用PS做的图片，这是怎么做到的呢？今天园子...</small></li><li><a href="http://www.yzznl.cn/archives/36.html" title="CSS布局命名规则">CSS布局命名规则</a> (1)<br /><small>近半年来园子一直试着遵循<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="WEB标准">WEB标准</a></span>设计和制作网页，今天花些时间整理一下在布局过程中会频繁用到...</small></li><li><a href="http://www.yzznl.cn/archives/10.html" title="常用的CSS单位">常用的CSS单位</a> (0)<br /><small>国内大多数站点都采用px作为字体的单位，当然也包括园子的网站。而国外的一些主流英文站点，几乎...</small></li><li><a href="http://www.yzznl.cn/archives/9.html" title="css语法结构">css语法结构</a> (0)<br /><small>css的语法结构由三部分组成：选择符（Selector）、属性（property）、和值（v...</small></li></ul><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="h1~h6的使用原则" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F67.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F108.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">h1~h6的使用原则</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="网站布局设计原则" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F17.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F108.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">网站布局设计原则</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="2010郑州大河车展比亚迪现场混战图片" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fbyd-dealer-fraud.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F108.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4291682.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">2010郑州大河车展比亚迪现场混战图片</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="深度专用链接转换器 – 迅雷、快车下载链接加密解密工具" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F310.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F108.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4292541.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">深度专用链接转换器 – 迅雷、快车下载链接加密解密工具</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="CorelDRAW X4 加速补丁，完美解决打开文件慢的问题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fx4-patch.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F108.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/07/02/15556112.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CorelDRAW X4 加速补丁，完美解决打开文件慢的问题</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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://www.yzznl.cn/archives/108.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSS入门知识</title>
		<link>http://www.yzznl.cn/archives/81.html</link>
		<comments>http://www.yzznl.cn/archives/81.html#comments</comments>
		<pubDate>Mon, 09 Mar 2009 01:59:20 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[Css]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/archives/75-2.html</guid>
		<description><![CDATA[我们首先要了解下面几点关于css方面的必备常识： CSS是Cascading Style Sheets(层叠样式表)的简称。 CSS语言是一种标记语言,它不需要编译,可以直接由浏览器执行(属于浏览器解释型语言)。 在标准网页设计中CSS负责网页内容(xhtml)的表现。 CSS文件也可以说是一个文本文件,它包含了一些CSS标记,CSS文件必须使用css为文件名后缀。 可以通过简单的更改CSS文件,改变网页的整体表现形式,可以减少我们的工作量,所以她是每一个网页设计人员的必修课。 CSS是由W3C的CSS工作组产生和维护的。 了解了这么多您一定想知道CSS的优势在哪里，园子把重要的几点列举了出来： 表现和内容相分离 将设计部分剥离出来放在一个独立样式文件中，HTML文件中只存放文本信息。这样的页面对搜索引擎更加友好。 提高页面浏览速度 对于同一个页面视觉效果，采用CSS+DIV重构的页面容量要比TABLE编码的页面文件容量小得多，前者一般只有后者的1/2大小。浏览器就不用去编译大量冗长的标签。 易于维护和改版 你只要简单的修改几个CSS文件就可以重新设计整个网站的页面。 一些在网页中常用的CSS属性： 文字或元素的颜色 color 背景颜色 background-color 背景图像 background-image 字体 font-family 文字大小 font-size 列表样式 list 鼠标样式 cursor 边框样式 border 内补白 padding 外边距 margin 等等&#8230; 入门知识暂时就说到这里吧，在以后的文章里园子将与大家一起学习如何在网页中应用CSS，以共同见证CSS的强大魔力。 扩展阅读用 CSS 实现网页的翻转效果 (38)有时候我们需要给用户一点惊喜，一些与众不同。当你访问一个网站的时候发现网站的整个界面都是水平...CSS专题之精华文章汇总 (7)Cascading Style Sheets（层叠样式表），简写为CSS，由W3C定义和维护...CSS中巧用 nowrap 属性禁止文字自动换行 (3)设计页面的时候，我们往往需要把内容在一行里面显示，也就是禁止让文字自动换行，首先来看下下面的...CSS Hack 汇总 (2)什么是 CSS Hack ？ [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="table转div工具：Table2CSS Converter汉化版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftable2css-converter.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F81.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4290804.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">table转div工具：Table2CSS Converter汉化版下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2Fcss-skills-summary.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F81.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS技巧汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F8.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F81.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS入门</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F74.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F81.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">如何优化CSS文件</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F9.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F81.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">css语法结构</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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><span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/css" title="css">css</a></span></strong>方面的必备常识：</p>
<ul>
<li>CSS是Cascading Style Sheets(层叠样式表)的简称。</li>
<li>CSS语言是一种标记语言,它不需要编译,可以直接由浏览器执行(属于浏览器解释型语言)。</li>
<li>在标准网页设计中CSS负责网页内容(<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/xhtml" title="xhtml">xhtml</a></span>)的表现。</li>
<li>CSS文件也可以说是一个文本文件,它包含了一些CSS标记,CSS文件必须使用css为文件名后缀。</li>
<li>可以通过简单的更改CSS文件,改变网页的整体表现形式,可以减少我们的工作量,所以她是每一个网页设计人员的必修课。</li>
<li>CSS是由W3C的CSS工作组产生和维护的。</li>
</ul>
<p><span id="more-36103"></span></p>
<p>了解了这么多您一定想知道CSS的优势在哪里，<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/about" title="园子" rel="nofollow">园子</a></span>把重要的几点列举了出来：</p>
<ul>
<li><strong>表现和内容相分离<br />
</strong>将设计部分剥离出来放在一个独立样式文件中，HTML文件中只存放文本信息。这样的页面对搜索引擎更加友好。</li>
<li><strong>提高页面浏览速度<br />
</strong>对于同一个页面视觉效果，采用CSS+DIV重构的页面容量要比TABLE编码的页面文件容量小得多，前者一般只有后者的1/2大小。浏览器就不用去编译大量冗长的标签。</li>
<li><strong>易于维护和改版</strong><br />
你只要简单的修改几个CSS文件就可以重新设计整个网站的页面。</li>
</ul>
<p>一些在网页中常用的CSS属性：</p>
<ul>
<li>文字或元素的颜色 color</li>
<li>背景颜色 background-color</li>
<li>背景图像 background-image</li>
<li>字体 font-family</li>
<li>文字大小 font-size</li>
<li>列表样式 list</li>
<li>鼠标样式 cursor</li>
<li>边框样式 border</li>
<li>内补白 padding</li>
<li>外边距 margin</li>
<li>等等&#8230;</li>
</ul>
<p>入门知识暂时就说到这里吧，在以后的文章里园子将与大家一起学习如何在网页中应用<strong>CSS</strong>，以共同见证CSS的强大魔力。</p>
<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/flip-page.html" title="用 CSS 实现网页的翻转效果">用 CSS 实现网页的翻转效果</a> (38)<br /><small>有时候我们需要给用户一点惊喜，一些与众不同。当你访问一个网站的时候发现网站的整个界面都是水平...</small></li><li><a href="http://www.yzznl.cn/archives/223.html" title="CSS专题之精华文章汇总">CSS专题之精华文章汇总</a> (7)<br /><small>Cascading Style Sheets（层叠样式表），简写为CSS，由W3C定义和维护...</small></li><li><a href="http://www.yzznl.cn/archives/201.html" title="CSS中巧用 nowrap 属性禁止文字自动换行">CSS中巧用 nowrap 属性禁止文字自动换行</a> (3)<br /><small>设计页面的时候，我们往往需要把内容在一行里面显示，也就是禁止让文字自动换行，首先来看下下面的...</small></li><li><a href="http://www.yzznl.cn/archives/200.html" title="CSS Hack 汇总">CSS Hack 汇总</a> (2)<br /><small>什么是 CSS Hack ？

由于不同的浏览器，比如 IE6.0，IE7.0，IE8....</small></li><li><a href="http://www.yzznl.cn/archives/108.html" title="id与class的使用原则">id与class的使用原则</a> (3)<br /><small>在前面的文章里园子主要与大家分享了CSS的入门知识以及CSS技巧汇总。在用CSS来控制网页布...</small></li><li><a href="http://www.yzznl.cn/archives/74.html" title="如何优化CSS文件">如何优化CSS文件</a> (4)<br /><small>尽管现在的网络质量日新月异的发展着，但做为网页设计者还是非常在意网站的交互速度。我们都知道，...</small></li><li><a href="http://www.yzznl.cn/archives/73.html" title="用CSS做的几个漂亮按钮">用CSS做的几个漂亮按钮</a> (0)<br /><small>你是否发现有些网站制作的按钮非常漂亮，而且还不是使用PS做的图片，这是怎么做到的呢？今天园子...</small></li><li><a href="http://www.yzznl.cn/archives/36.html" title="CSS布局命名规则">CSS布局命名规则</a> (1)<br /><small>近半年来园子一直试着遵循<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="WEB标准">WEB标准</a></span>设计和制作网页，今天花些时间整理一下在布局过程中会频繁用到...</small></li><li><a href="http://www.yzznl.cn/archives/10.html" title="常用的CSS单位">常用的CSS单位</a> (0)<br /><small>国内大多数站点都采用px作为字体的单位，当然也包括园子的网站。而国外的一些主流英文站点，几乎...</small></li><li><a href="http://www.yzznl.cn/archives/9.html" title="css语法结构">css语法结构</a> (0)<br /><small>css的语法结构由三部分组成：选择符（Selector）、属性（property）、和值（v...</small></li></ul><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="table转div工具：Table2CSS Converter汉化版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftable2css-converter.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F81.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4290804.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">table转div工具：Table2CSS Converter汉化版下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2Fcss-skills-summary.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F81.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS技巧汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F8.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F81.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS入门</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F74.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F81.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">如何优化CSS文件</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F9.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F81.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">css语法结构</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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://www.yzznl.cn/archives/81.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>如何优化CSS文件</title>
		<link>http://www.yzznl.cn/archives/74.html</link>
		<comments>http://www.yzznl.cn/archives/74.html#comments</comments>
		<pubDate>Mon, 02 Mar 2009 08:42:55 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[Css]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/archives/74.html</guid>
		<description><![CDATA[尽管现在的网络质量日新月异的发展着，但做为网页设计者还是非常在意网站的交互速度。我们都知道，Web网站可用性的关键指标是速度，更确切地说，是页面能以多快的速度出现在访问者的浏览器窗口里。我们力求努力做到让自己的网站速度更快一些，常常要做的是去优化站点里每一个图像文件，但是你知道吗，css文件也是需要优化的。园子在做一个企业站点时把优化过的CSS和之前用Dreamweaver自动生成的CSS做了下对比，结果竟然发现文件大小缩减了35%！ 其实优化CSS文件非常简单，只要我们在网站完成之后把CSS文件做下规整，注意下一些比较常用的缩写方法，你也可以让你的CSS文件做到真正的优化。 当属性值为0时 书写原则是如果CSS属性值为0，那么你不必为其添加单位(如:px/em)，你可能会这样写: padding: 10px 5px 0px 0px; 试试这样吧: padding: 10px 5px 0 0; 移除选择器 选择器是你在为一些元素应用CSS样式时的基本方法，比如h1, h2, h2, div, strong, pre, ul, ol等等…如果你使用了class(.类名)或ID(#id名),那么就不用再在声明CSS时包含选择器了。 div#logowrap 尝试扔掉多余的选择器吧: #logowrap 在这个例子中所谓的那个选择器就是div 学会使用万能通配符* 要明智的使用*而避免它在整个CSS样式表中乱开玩笑，*是个通配符，你可以使用它来为你的设计部分或全部进行一系列CSS声明。例如: * { margin: 0; } 这个声明会将所有元素的margin值设置为0，同样的，为了严谨起见，你可以尝试这样设置: #menu * { margin: 0; } 这样的声明是指将#menu下的所有元素的margin设为0。 背景的缩写方法 背景(background)属性可能会包含设置背景色、背景图、背景图的位置和背景图重复方式的参数，你可能会写成: background-image: url(”logo.png”); background-position: top center; background-repeat: no-repeat; 其实可以缩写成: background: url(logo.png) [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" 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%2Fwww.yzznl.cn%2Farchives%2Fcss-skills-summary.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F74.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS技巧汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="table转div工具：Table2CSS Converter汉化版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftable2css-converter.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F74.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4290804.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">table转div工具：Table2CSS Converter汉化版下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F83.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F74.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/07/28/19572064.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">详解CSS盒模型</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F81.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F74.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS入门知识</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F10.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F74.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">常用的CSS单位</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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>尽管现在的网络质量日新月异的发展着，但做为网页设计者还是非常在意网站的交互速度。我们都知道，Web网站可用性的关键指标是速度，更确切地说，是页面能以多快的速度出现在访问者的浏览器窗口里。我们力求努力做到让自己的网站速度更快一些，常常要做的是去优化站点里每一个图像文件，但是你知道吗，<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/css" title="css">css</a></span>文件也是需要优化的。<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/about" title="园子" rel="nofollow">园子</a></span>在做一个企业站点时把优化过的CSS和之前用Dreamweaver自动生成的CSS做了下对比，结果竟然发现文件大小缩减了35%！</p>
<p>其实优化CSS文件非常简单，只要我们在网站完成之后把CSS文件做下规整，注意下一些比较常用的缩写方法，你也可以让你的CSS文件做到真正的优化。<br />
<span id="more-35673"></span></p>
<p><strong>当属性值为0时</strong><br />
书写原则是如果CSS属性值为0，那么你不必为其添加单位(如:px/em)，你可能会这样写:<br />
<span style="color: #0099cc;">padding: 10px 5px 0px 0px;</span></p>
<p>试试这样吧:<br />
<span style="color: #0099cc;">padding: 10px 5px 0 0;</span></p>
<p><strong>移除选择器</strong><br />
选择器是你在为一些元素应用CSS样式时的基本方法，比如h1, h2, h2, div, strong, pre, ul, ol等等…如果你使用了class(.类名)或ID(#id名),那么就不用再在声明CSS时包含选择器了。</p>
<p><span style="color: #0099cc;">div#logowrap</span></p>
<p>尝试扔掉多余的选择器吧:<br />
<span style="color: #0099cc;">#logowrap</span></p>
<p>在这个例子中所谓的那个选择器就是div</p>
<p><strong>学会使用万能通配符*<br />
</strong>要明智的使用*而避免它在整个CSS样式表中乱开玩笑，*是个通配符，你可以使用它来为你的设计部分或全部进行一系列CSS声明。例如:</p>
<p><span style="color: #0099cc;">* {<br />
margin: 0;<br />
}</span></p>
<p>这个声明会将所有元素的margin值设置为0，同样的，为了严谨起见，你可以尝试这样设置:<br />
<span style="color: #0099cc;">#menu * {<br />
margin: 0;<br />
}</span></p>
<p>这样的声明是指将#menu下的所有元素的margin设为0。</p>
<p><strong>背景的缩写方法</strong><br />
背景(background)属性可能会包含设置背景色、背景图、背景图的位置和背景图重复方式的参数，你可能会写成:<br />
<span style="color: #0099cc;">background-image: url(”logo.png”);<br />
background-position: top center;<br />
background-repeat: no-repeat;</span></p>
<p>其实可以缩写成:<br />
<span style="color: #0099cc;">background: url(logo.png) no-repeat top center;</span></p>
<p><strong>颜色</strong><br />
颜色(color)属性在CSS通常指定为一个十六进制的值,一个#加6位数字，他的简写方式是如果颜色值由成对儿出现的三对而数字组成，你可以省略掉没对中的一个数字。</p>
<p><span style="color: #0099cc;">#000000 可以写成 #000, #336699 可以写成 #369</span></p>
<p>这种简写技巧只适用于成对出现的颜色值（即奇数位色值和偶数位色值相同时），其它颜色值不适用这种技巧，比如:<br />
<span style="color: #0099cc;">#010101, #223345, #FFF000</span></p>
<p><strong>Margin(外边距/空白边)的缩写</strong><br />
声明CSS magin值得时候通常会写成这样:<br />
<span style="color: #0099cc;">margin-top:0px;<br />
margin-right:10px;<br />
margin-bottom:0px;<br />
margin-left:10px;</span></p>
<p>让我们试试把值为0的单位去掉，并把4条声明合并成一条声明:<br />
<span style="color: #0099cc;">margin:0 10px 0 10px;</span></p>
<p>当你声名padding、margin、border(还有一些其他属性)时，记得要把按照顺时针的方向来声明属性值，也就是按照上-右-下-左的方向。关于这些属性还有另一个更加简单的写法，看看属性中上和下、左和右是否值是相等的，如果是那么就可以进一步优化了，你可以省略掉后两个值，剩下的两个值前者指上下，后者指左右:<br />
<span style="color: #0099cc;">margin:0 10px;</span></p>
<p>它是指左右的值为10px，上下的值为0；Padding(内边距)padding的简写技巧等同于margin:</p>
<p><span style="color: #0099cc;">padding-top:0px;<br />
padding-right:10px;<br />
padding-bottom:0px;<br />
padding-left:10px;</span></p>
<p>可以写成:<br />
<span style="color: #0099cc;">padding: 0 10px;</span></p>
<p><strong>Border(边框)边框的缩写</strong><br />
border缩写的方式相比其它声明来说会比较复杂，很多CSSer一开始都容易记混它的简写顺序，如果你想声明一个1像素宽的实线黑色边框，可能会写成:<br />
<span style="color: #0099cc;">border-width:1px;<br />
border-style:solid;<br />
border-color:#000;</span></p>
<p>其实可以写成:<br />
<span style="color: #0099cc;">border:1px solid #000;</span></p>
<p>注意:这里的颜色值已经使用了上面讲过的颜色简写方法了哦。我们还可以为四个边设置不同的宽度:<br />
<span style="color: #0099cc;">border-top-width:1px;<br />
border-right-width:2px;<br />
border-bottom-width:3px;<br />
border-left-width:4px;</span></p>
<p>可以简写成:<br />
<span style="color: #0099cc;">border-width:1px 2px 3px 4px;</span></p>
<p>最后，我们还可以只设置右和下边框的样式:<br />
<span style="color: #0099cc;">border-right:1px solid #000;<br />
border-bottom:1px solid #000;</span></p>
<p>虽然并没减少多少代码,但园子建议写成这样:<br />
<span style="color: #0099cc;">border:1px solid #000;<br />
border-width:0 1px 1px 0;</span></p>
<p>先设置四个边的默认风格，然后声明具体的哪个边要显示。</p>
<p>文字属性的缩写<br />
文字属性也有很多可能会用到的属性值，像背景一样，你可能会声明这种复杂的文字样式:<br />
<span style="color: #0099cc;">font-style:italic;<br />
font-variant:small-caps;<br />
font-weight:bold;<br />
font-size:1em;<br />
line-height:150%;<br />
font-family:宋体, Arial, sans-serif;</span></p>
<p>其实可以优化成一行:<br />
<span style="color: #0099cc;">font:italic small-caps bold 1em/150% 宋体, Arial, sans-serif;</span></p>
<p>列表的缩写<br />
<span style="color: #0099cc;">list-style-type:square;<br />
list-style-position:inside;<br />
list-style-image:url(filename.gif);</span></p>
<p>可以写成:<br />
<span style="color: #0099cc;">list-style:square inside url(filename.gif);</span></p>
<p>再给大家举个综合的例子，请看下面的CSS代码：<br />
<span style="color: #0099cc;">.sample1 {<br />
margin-top: 15px;<br />
margin-right: 20px;<br />
margin-bottom: 12px;<br />
margin-left: 24px;<br />
padding-top: 5px;<br />
padding-right: 10px;<br />
padding-bottom: 4px;<br />
padding-left: 8px;<br />
border-top-width: thin;<br />
border-top-style: solid;<br />
border-top-color: #000000;<br />
}</span></p>
<p>将它用一些缩写性质来替代就能够把代码减少为下面这样，两者的实际效果是完全一样的：<br />
<span style="color: #0099cc;">.sample1 {<br />
margin: 15px 20px 12px 24px;<br />
padding: 5px 10px 4px 8px;<br />
border-top: thin solid #000;<br />
}</span></p>
<p><strong>下面是CSS缩写性质的列表以及它们所表示的常规性质。</strong></p>
<ul>
<li>Background（背景）：背景附件、背景颜色、背景图像、背景位置、背景重复</li>
<li>Border（边框）：边框颜色、边框风格、边框宽度</li>
<li>border-bottom（底部边框）：底部边框颜色、底部边框样式、底部边框宽度</li>
<li>border-left（左侧边框）：左侧边框颜色、左侧边框样式、左侧边框宽度</li>
<li>border-right（右侧边框）：右侧边框颜色、右侧边框样式、右侧边框宽度</li>
<li>border-top（顶部边框）：顶部边框颜色、顶部边框样式、顶部边框宽度</li>
<li>cue（声音提示）：前提示、后提示</li>
<li>font（字体）：字体、字号、字体样式、字体粗细、字体变体、线高度、字体大小调整、字体拉伸</li>
<li>list-style（列表样式）：列表样式图像、列表样式位置、列表样式类型</li>
<li>margin（空白）：顶部空白、右侧空白、底部空白、左侧空白</li>
<li>outline（大纲）：大纲颜色、大纲样式、大纲宽度</li>
<li>padding（间隙）：顶部间隙、右侧间隙、底部间隙、左侧间隙</li>
<li>pause（暂停）：后暂停、前暂停</li>
</ul>
<p>总结了这么多，园子相信只要你留意正确的缩写方法，你也可以在最短的时间内把你的CSS优化好。赶快尝试一下吧。</p>
<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/flip-page.html" title="用 CSS 实现网页的翻转效果">用 CSS 实现网页的翻转效果</a> (38)<br /><small>有时候我们需要给用户一点惊喜，一些与众不同。当你访问一个网站的时候发现网站的整个界面都是水平...</small></li><li><a href="http://www.yzznl.cn/archives/223.html" title="CSS专题之精华文章汇总">CSS专题之精华文章汇总</a> (7)<br /><small>Cascading Style Sheets（层叠样式表），简写为CSS，由W3C定义和维护...</small></li><li><a href="http://www.yzznl.cn/archives/201.html" title="CSS中巧用 nowrap 属性禁止文字自动换行">CSS中巧用 nowrap 属性禁止文字自动换行</a> (3)<br /><small>设计页面的时候，我们往往需要把内容在一行里面显示，也就是禁止让文字自动换行，首先来看下下面的...</small></li><li><a href="http://www.yzznl.cn/archives/200.html" title="CSS Hack 汇总">CSS Hack 汇总</a> (2)<br /><small>什么是 CSS Hack ？

由于不同的浏览器，比如 IE6.0，IE7.0，IE8....</small></li><li><a href="http://www.yzznl.cn/archives/108.html" title="id与class的使用原则">id与class的使用原则</a> (3)<br /><small>在前面的文章里园子主要与大家分享了CSS的入门知识以及CSS技巧汇总。在用CSS来控制网页布...</small></li><li><a href="http://www.yzznl.cn/archives/81.html" title="CSS入门知识">CSS入门知识</a> (1)<br /><small>我们首先要了解下面几点关于CSS方面的必备常识：


	CSS是Cascading S...</small></li><li><a href="http://www.yzznl.cn/archives/73.html" title="用CSS做的几个漂亮按钮">用CSS做的几个漂亮按钮</a> (0)<br /><small>你是否发现有些网站制作的按钮非常漂亮，而且还不是使用PS做的图片，这是怎么做到的呢？今天园子...</small></li><li><a href="http://www.yzznl.cn/archives/36.html" title="CSS布局命名规则">CSS布局命名规则</a> (1)<br /><small>近半年来园子一直试着遵循<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="WEB标准">WEB标准</a></span>设计和制作网页，今天花些时间整理一下在布局过程中会频繁用到...</small></li><li><a href="http://www.yzznl.cn/archives/10.html" title="常用的CSS单位">常用的CSS单位</a> (0)<br /><small>国内大多数站点都采用px作为字体的单位，当然也包括园子的网站。而国外的一些主流英文站点，几乎...</small></li><li><a href="http://www.yzznl.cn/archives/9.html" title="css语法结构">css语法结构</a> (0)<br /><small>css的语法结构由三部分组成：选择符（Selector）、属性（property）、和值（v...</small></li></ul><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" 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%2Fwww.yzznl.cn%2Farchives%2Fcss-skills-summary.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F74.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS技巧汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="table转div工具：Table2CSS Converter汉化版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftable2css-converter.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F74.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4290804.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">table转div工具：Table2CSS Converter汉化版下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F83.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F74.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/07/28/19572064.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">详解CSS盒模型</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F81.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F74.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS入门知识</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F10.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F74.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">常用的CSS单位</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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://www.yzznl.cn/archives/74.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>用CSS做的几个漂亮按钮</title>
		<link>http://www.yzznl.cn/archives/73.html</link>
		<comments>http://www.yzznl.cn/archives/73.html#comments</comments>
		<pubDate>Mon, 02 Mar 2009 08:10:34 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[Css]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/archives/73.html</guid>
		<description><![CDATA[你是否发现有些网站制作的按钮非常漂亮，而且还不是使用PS做的图片，这是怎么做到的呢？今天园子就和大家一起见证一下css的强大威力，下图中的几个按钮都是通过CSS的定义制作出来的按钮效果，代码今天也共享出来，有需要的朋友直接复制代码到CSS样式表里面即可。 需要说明下的是，按钮中的渐变效果只在IE等浏览器下可以显示效果，Firefox浏览器下显示的按钮背景是灰色的。CSS代码如下： 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 .btn &#123; BORDER-RIGHT: #7b9ebd 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7b9ebd 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; FILTER: progid:DXImageTransform.Microsoft.Gradient&#40;GradientType=0, StartColorStr=#ffffff, EndColorStr=#cecfde&#41;; BORDER-LEFT: #7b9ebd 1px solid; CURSOR: hand; [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" 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%2Fwww.yzznl.cn%2Farchives%2Fcss-skills-summary.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F73.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS技巧汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="table转div工具：Table2CSS Converter汉化版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftable2css-converter.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F73.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4290804.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">table转div工具：Table2CSS Converter汉化版下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F83.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F73.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/07/28/19572064.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">详解CSS盒模型</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F8.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F73.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS入门</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2Fflip-page.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F73.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/04/06/5103756.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">用 CSS 实现网页的翻转效果</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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>你是否发现有些网站制作的按钮非常漂亮，而且还不是使用PS做的图片，这是怎么做到的呢？今天<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/about" title="园子" rel="nofollow">园子</a></span>就和大家一起见证一下<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/css" title="css">css</a></span>的强大威力，下图中的几个按钮都是通过CSS的定义制作出来的按钮效果，代码今天也共享出来，有需要的朋友直接复制代码到CSS样式表里面即可。</p>
<p><img src="http://www.yzznl.cn/wp-content/uploads/2009/03/css_button.gif" alt="css按钮截图" /><br />
<span id="more-35671"></span></p>
<p>需要说明下的是，按钮中的渐变效果只在IE等浏览器下可以显示效果，Firefox浏览器下显示的按钮背景是灰色的。CSS代码如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="css" style="font-family:Microsoft YaHei,Arial;"><span style="color: #6666ff;">.btn</span> <span style="color: #00AA00;">&#123;</span>
 BORDER-RIGHT<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#7b9ebd</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> PADDING-RIGHT<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> BORDER-TOP<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#7b9ebd</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> PADDING-LEFT<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> FONT-SIZE<span style="color: #00AA00;">:</span> <span style="color: #933;">12px</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>.Gradient<span style="color: #00AA00;">&#40;</span>GradientType<span style="color: #00AA00;">=</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> StartColorStr<span style="color: #00AA00;">=</span><span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;">,</span> EndColorStr<span style="color: #00AA00;">=</span><span style="color: #cc00cc;">#cecfde</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> BORDER-LEFT<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#7b9ebd</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> CURSOR<span style="color: #00AA00;">:</span> hand<span style="color: #00AA00;">;</span> COLOR<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span> PADDING-TOP<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> BORDER-BOTTOM<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#7b9ebd</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.btn1_mouseout</span> <span style="color: #00AA00;">&#123;</span>
 BORDER-RIGHT<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#7EBF4F</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> PADDING-RIGHT<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> BORDER-TOP<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#7EBF4F</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> PADDING-LEFT<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> FONT-SIZE<span style="color: #00AA00;">:</span> <span style="color: #933;">12px</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>.Gradient<span style="color: #00AA00;">&#40;</span>GradientType<span style="color: #00AA00;">=</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> StartColorStr<span style="color: #00AA00;">=</span><span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;">,</span> EndColorStr<span style="color: #00AA00;">=</span><span style="color: #cc00cc;">#B3D997</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> BORDER-LEFT<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#7EBF4F</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> CURSOR<span style="color: #00AA00;">:</span> hand<span style="color: #00AA00;">;</span> COLOR<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span> PADDING-TOP<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> BORDER-BOTTOM<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#7EBF4F</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.btn1_mouseover</span> <span style="color: #00AA00;">&#123;</span>
 BORDER-RIGHT<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#7EBF4F</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> PADDING-RIGHT<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> BORDER-TOP<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#7EBF4F</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> PADDING-LEFT<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> FONT-SIZE<span style="color: #00AA00;">:</span> <span style="color: #933;">12px</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>.Gradient<span style="color: #00AA00;">&#40;</span>GradientType<span style="color: #00AA00;">=</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> StartColorStr<span style="color: #00AA00;">=</span><span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;">,</span> EndColorStr<span style="color: #00AA00;">=</span><span style="color: #cc00cc;">#CAE4B6</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> BORDER-LEFT<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#7EBF4F</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> CURSOR<span style="color: #00AA00;">:</span> hand<span style="color: #00AA00;">;</span> COLOR<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span> PADDING-TOP<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> BORDER-BOTTOM<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#7EBF4F</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.btn2</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">2</span> <span style="color: #cc66cc;">4</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">4</span><span style="color: #00AA00;">;</span>font-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>height<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">23</span><span style="color: #00AA00;">;</span>background-<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#ece9d8</span><span style="color: #00AA00;">;</span>border-<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.btn3_mouseout</span> <span style="color: #00AA00;">&#123;</span>
 BORDER-RIGHT<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#2C59AA</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> PADDING-RIGHT<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> BORDER-TOP<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#2C59AA</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> PADDING-LEFT<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> FONT-SIZE<span style="color: #00AA00;">:</span> <span style="color: #933;">12px</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>.Gradient<span style="color: #00AA00;">&#40;</span>GradientType<span style="color: #00AA00;">=</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> StartColorStr<span style="color: #00AA00;">=</span><span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;">,</span> EndColorStr<span style="color: #00AA00;">=</span><span style="color: #cc00cc;">#C3DAF5</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> BORDER-LEFT<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#2C59AA</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> CURSOR<span style="color: #00AA00;">:</span> hand<span style="color: #00AA00;">;</span> COLOR<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span> PADDING-TOP<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> BORDER-BOTTOM<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#2C59AA</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.btn3_mouseover</span> <span style="color: #00AA00;">&#123;</span>
 BORDER-RIGHT<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#2C59AA</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> PADDING-RIGHT<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> BORDER-TOP<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#2C59AA</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> PADDING-LEFT<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> FONT-SIZE<span style="color: #00AA00;">:</span> <span style="color: #933;">12px</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>.Gradient<span style="color: #00AA00;">&#40;</span>GradientType<span style="color: #00AA00;">=</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> StartColorStr<span style="color: #00AA00;">=</span><span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;">,</span> EndColorStr<span style="color: #00AA00;">=</span><span style="color: #cc00cc;">#D7E7FA</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> BORDER-LEFT<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#2C59AA</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> CURSOR<span style="color: #00AA00;">:</span> hand<span style="color: #00AA00;">;</span> COLOR<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span> PADDING-TOP<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> BORDER-BOTTOM<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#2C59AA</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.btn3_mousedown</span>
<span style="color: #00AA00;">&#123;</span>
 BORDER-RIGHT<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFE400</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> PADDING-RIGHT<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> BORDER-TOP<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFE400</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> PADDING-LEFT<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> FONT-SIZE<span style="color: #00AA00;">:</span> <span style="color: #933;">12px</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>.Gradient<span style="color: #00AA00;">&#40;</span>GradientType<span style="color: #00AA00;">=</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> StartColorStr<span style="color: #00AA00;">=</span><span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;">,</span> EndColorStr<span style="color: #00AA00;">=</span><span style="color: #cc00cc;">#C3DAF5</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> BORDER-LEFT<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFE400</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> CURSOR<span style="color: #00AA00;">:</span> hand<span style="color: #00AA00;">;</span> COLOR<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span> PADDING-TOP<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> BORDER-BOTTOM<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFE400</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.btn3_mouseup</span> <span style="color: #00AA00;">&#123;</span>
 BORDER-RIGHT<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#2C59AA</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> PADDING-RIGHT<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> BORDER-TOP<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#2C59AA</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> PADDING-LEFT<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> FONT-SIZE<span style="color: #00AA00;">:</span> <span style="color: #933;">12px</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>.Gradient<span style="color: #00AA00;">&#40;</span>GradientType<span style="color: #00AA00;">=</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> StartColorStr<span style="color: #00AA00;">=</span><span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;">,</span> EndColorStr<span style="color: #00AA00;">=</span><span style="color: #cc00cc;">#C3DAF5</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> BORDER-LEFT<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#2C59AA</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> CURSOR<span style="color: #00AA00;">:</span> hand<span style="color: #00AA00;">;</span> COLOR<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span> PADDING-TOP<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> BORDER-BOTTOM<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#2C59AA</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.btn_2k3</span> <span style="color: #00AA00;">&#123;</span>
 BORDER-RIGHT<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#002D96</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> PADDING-RIGHT<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> BORDER-TOP<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#002D96</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> PADDING-LEFT<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> FONT-SIZE<span style="color: #00AA00;">:</span> <span style="color: #933;">12px</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>.Gradient<span style="color: #00AA00;">&#40;</span>GradientType<span style="color: #00AA00;">=</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> StartColorStr<span style="color: #00AA00;">=</span><span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">,</span> EndColorStr<span style="color: #00AA00;">=</span><span style="color: #cc00cc;">#9DBCEA</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> BORDER-LEFT<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#002D96</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span> CURSOR<span style="color: #00AA00;">:</span> hand<span style="color: #00AA00;">;</span> COLOR<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span> PADDING-TOP<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> BORDER-BOTTOM<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#002D96</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span>
<span style="color: #00AA00;">&#125;</span>
–<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/flip-page.html" title="用 CSS 实现网页的翻转效果">用 CSS 实现网页的翻转效果</a> (38)<br /><small>有时候我们需要给用户一点惊喜，一些与众不同。当你访问一个网站的时候发现网站的整个界面都是水平...</small></li><li><a href="http://www.yzznl.cn/archives/223.html" title="CSS专题之精华文章汇总">CSS专题之精华文章汇总</a> (7)<br /><small>Cascading Style Sheets（层叠样式表），简写为CSS，由W3C定义和维护...</small></li><li><a href="http://www.yzznl.cn/archives/201.html" title="CSS中巧用 nowrap 属性禁止文字自动换行">CSS中巧用 nowrap 属性禁止文字自动换行</a> (3)<br /><small>设计页面的时候，我们往往需要把内容在一行里面显示，也就是禁止让文字自动换行，首先来看下下面的...</small></li><li><a href="http://www.yzznl.cn/archives/200.html" title="CSS Hack 汇总">CSS Hack 汇总</a> (2)<br /><small>什么是 CSS Hack ？

由于不同的浏览器，比如 IE6.0，IE7.0，IE8....</small></li><li><a href="http://www.yzznl.cn/archives/108.html" title="id与class的使用原则">id与class的使用原则</a> (3)<br /><small>在前面的文章里园子主要与大家分享了CSS的入门知识以及CSS技巧汇总。在用CSS来控制网页布...</small></li><li><a href="http://www.yzznl.cn/archives/81.html" title="CSS入门知识">CSS入门知识</a> (1)<br /><small>我们首先要了解下面几点关于CSS方面的必备常识：


	CSS是Cascading S...</small></li><li><a href="http://www.yzznl.cn/archives/74.html" title="如何优化CSS文件">如何优化CSS文件</a> (4)<br /><small>尽管现在的网络质量日新月异的发展着，但做为网页设计者还是非常在意网站的交互速度。我们都知道，...</small></li><li><a href="http://www.yzznl.cn/archives/36.html" title="CSS布局命名规则">CSS布局命名规则</a> (1)<br /><small>近半年来园子一直试着遵循<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="WEB标准">WEB标准</a></span>设计和制作网页，今天花些时间整理一下在布局过程中会频繁用到...</small></li><li><a href="http://www.yzznl.cn/archives/10.html" title="常用的CSS单位">常用的CSS单位</a> (0)<br /><small>国内大多数站点都采用px作为字体的单位，当然也包括园子的网站。而国外的一些主流英文站点，几乎...</small></li><li><a href="http://www.yzznl.cn/archives/9.html" title="css语法结构">css语法结构</a> (0)<br /><small>css的语法结构由三部分组成：选择符（Selector）、属性（property）、和值（v...</small></li></ul><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" 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%2Fwww.yzznl.cn%2Farchives%2Fcss-skills-summary.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F73.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS技巧汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="table转div工具：Table2CSS Converter汉化版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftable2css-converter.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F73.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4290804.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">table转div工具：Table2CSS Converter汉化版下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F83.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F73.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/07/28/19572064.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">详解CSS盒模型</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F8.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F73.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS入门</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2Fflip-page.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F73.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/04/06/5103756.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">用 CSS 实现网页的翻转效果</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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://www.yzznl.cn/archives/73.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS布局命名规则</title>
		<link>http://www.yzznl.cn/archives/36.html</link>
		<comments>http://www.yzznl.cn/archives/36.html#comments</comments>
		<pubDate>Mon, 19 Jan 2009 07:40:42 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[Css]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/archives/36.html</guid>
		<description><![CDATA[近半年来园子一直试着遵循WEB标准设计和制作网页，今天花些时间整理一下在布局过程中会频繁用到的一些命名规则，当然，这些命名并不是绝对的，只是园子认为有个良好的命名习惯无论是对网站后期维护还是团队协作方面都会有很大的帮助。 网站一般布局命名 页头:header 登录条:loginBar 标志:logo 侧栏:sideBar 广告:banner 导航:nav 子导航:subNav 菜单:menu 子菜单:subMenu 搜索:search 滚动:scroll 页面主体:main 内容:content 指南:guild 服务:service 热点:hot 新闻:news 下载:download 注册:regsiter 状态:status 标签页:tab 文章列表:list 提示信息:msg 小技巧:tips 栏目标题:title 加入:joinus 按钮:btn 投票:vote 合作伙伴:partner 友情链接:friendLink 页脚:footer 版权:copyRight 常用ID命名 外　套:wrap 主导航:mainNav 子导航:subnav 页　脚:footer 整个页面:　content 页　眉:header 页　脚:footer 子菜单:submenu 边导航图标:sidebarIcon 注释:　note 面包屑:breadCrumb(即页面所处位置导航提示) 容器:　container 内容:　content 搜索:　search 登陆:　login 功能区:shop(如购物车，收银台) 当前的　current 商　标:label 标　题:title 主导航:mainNav(globalNav) [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" 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%2Fwww.yzznl.cn%2Farchives%2Fcss-skills-summary.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F36.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS技巧汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="table转div工具：Table2CSS Converter汉化版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftable2css-converter.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F36.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4290804.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">table转div工具：Table2CSS Converter汉化版下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="Windows 7 无法重命名本地磁盘的解决方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fwin7-rename-disk.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F36.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2012/01/10/13751446.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Windows 7 无法重命名本地磁盘的解决方法</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="园子博客网站布局调整" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F394.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F36.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4292044.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">园子博客网站布局调整</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="CSS 定义的50个精美按钮下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F375.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F36.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/07/28/19572065.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS 定义的50个精美按钮下载</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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>近半年来<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/about" title="园子" rel="nofollow">园子</a></span>一直试着遵循<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="WEB标准">WEB标准</a></span>设计和制作网页，今天花些时间整理一下在布局过程中会频繁用到的一些命名规则，当然，这些命名并不是绝对的，只是园子认为有个良好的命名习惯无论是对网站后期维护还是团队协作方面都会有很大的帮助。<br />
<span id="more-32628"></span></p>
<p><strong>网站一般布局命名</strong></p>
<ul>
<li>页头:header</li>
<li>登录条:loginBar</li>
<li>标志:logo</li>
<li>侧栏:sideBar</li>
<li>广告:banner</li>
<li>导航:nav</li>
<li>子导航:subNav</li>
<li>菜单:menu</li>
<li>子菜单:subMenu</li>
<li>搜索:search</li>
<li>滚动:scroll</li>
<li>页面主体:main</li>
<li>内容:content</li>
<li>指南:guild</li>
<li>服务:service</li>
<li>热点:hot</li>
<li>新闻:news</li>
<li>下载:download</li>
<li>注册:regsiter</li>
<li>状态:status</li>
<li>标签页:tab</li>
<li>文章列表:list</li>
<li>提示信息:msg</li>
<li>小技巧:tips</li>
<li>栏目标题:title</li>
<li>加入:joinus</li>
<li>按钮:btn</li>
<li>投票:vote</li>
<li>合作伙伴:partner</li>
<li>友情链接:friendLink</li>
<li>页脚:footer</li>
<li>版权:copyRight</li>
</ul>
<p><strong>常用ID命名</strong></p>
<ul>
<li>外　套:wrap</li>
<li>主导航:mainNav</li>
<li>子导航:subnav</li>
<li>页　脚:footer</li>
<li>整个页面:　content</li>
<li>页　眉:header</li>
<li>页　脚:footer</li>
<li>子菜单:submenu</li>
<li>边导航图标:sidebarIcon</li>
<li>注释:　note</li>
<li>面包屑:breadCrumb(即页面所处位置导航提示)</li>
<li>容器:　container</li>
<li>内容:　content</li>
<li>搜索:　search</li>
<li>登陆:　login</li>
<li>功能区:shop(如购物车，收银台)</li>
<li>当前的　current</li>
<li>商　标:label</li>
<li>标　题:title</li>
<li>主导航:mainNav(globalNav)</li>
<li>顶导航:topnav</li>
<li>边导航:sidebar</li>
<li>左导航:leftsideBar</li>
<li>右导航:rightsideBar</li>
<li>旗　志:logo</li>
<li>标　语:banner</li>
<li>菜单内容1: menu1Content</li>
<li>菜单容量:　menuContainer</li>
</ul>
<p><span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/css" title="css">css</a></span>样式表的命名</p>
<ul>
<li>基本的或公用的：base.css</li>
<li>主要的:master.css</li>
<li>布局，版面:layout.css</li>
<li>打印样式:print.css</li>
<li>主题:themes.css</li>
<li>专栏:columns.css</li>
<li>针对文字:font.css</li>
</ul>
<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/flip-page.html" title="用 CSS 实现网页的翻转效果">用 CSS 实现网页的翻转效果</a> (38)<br /><small>有时候我们需要给用户一点惊喜，一些与众不同。当你访问一个网站的时候发现网站的整个界面都是水平...</small></li><li><a href="http://www.yzznl.cn/archives/223.html" title="CSS专题之精华文章汇总">CSS专题之精华文章汇总</a> (7)<br /><small>Cascading Style Sheets（层叠样式表），简写为CSS，由W3C定义和维护...</small></li><li><a href="http://www.yzznl.cn/archives/201.html" title="CSS中巧用 nowrap 属性禁止文字自动换行">CSS中巧用 nowrap 属性禁止文字自动换行</a> (3)<br /><small>设计页面的时候，我们往往需要把内容在一行里面显示，也就是禁止让文字自动换行，首先来看下下面的...</small></li><li><a href="http://www.yzznl.cn/archives/200.html" title="CSS Hack 汇总">CSS Hack 汇总</a> (2)<br /><small>什么是 CSS Hack ？

由于不同的浏览器，比如 IE6.0，IE7.0，IE8....</small></li><li><a href="http://www.yzznl.cn/archives/108.html" title="id与class的使用原则">id与class的使用原则</a> (3)<br /><small>在前面的文章里园子主要与大家分享了CSS的入门知识以及CSS技巧汇总。在用CSS来控制网页布...</small></li><li><a href="http://www.yzznl.cn/archives/81.html" title="CSS入门知识">CSS入门知识</a> (1)<br /><small>我们首先要了解下面几点关于CSS方面的必备常识：


	CSS是Cascading S...</small></li><li><a href="http://www.yzznl.cn/archives/74.html" title="如何优化CSS文件">如何优化CSS文件</a> (4)<br /><small>尽管现在的网络质量日新月异的发展着，但做为网页设计者还是非常在意网站的交互速度。我们都知道，...</small></li><li><a href="http://www.yzznl.cn/archives/73.html" title="用CSS做的几个漂亮按钮">用CSS做的几个漂亮按钮</a> (0)<br /><small>你是否发现有些网站制作的按钮非常漂亮，而且还不是使用PS做的图片，这是怎么做到的呢？今天园子...</small></li><li><a href="http://www.yzznl.cn/archives/10.html" title="常用的CSS单位">常用的CSS单位</a> (0)<br /><small>国内大多数站点都采用px作为字体的单位，当然也包括园子的网站。而国外的一些主流英文站点，几乎...</small></li><li><a href="http://www.yzznl.cn/archives/9.html" title="css语法结构">css语法结构</a> (0)<br /><small>css的语法结构由三部分组成：选择符（Selector）、属性（property）、和值（v...</small></li></ul><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" 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%2Fwww.yzznl.cn%2Farchives%2Fcss-skills-summary.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F36.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS技巧汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="table转div工具：Table2CSS Converter汉化版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftable2css-converter.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F36.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4290804.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">table转div工具：Table2CSS Converter汉化版下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="Windows 7 无法重命名本地磁盘的解决方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fwin7-rename-disk.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F36.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2012/01/10/13751446.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Windows 7 无法重命名本地磁盘的解决方法</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="园子博客网站布局调整" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F394.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F36.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4292044.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">园子博客网站布局调整</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="CSS 定义的50个精美按钮下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F375.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F36.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/07/28/19572065.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS 定义的50个精美按钮下载</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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://www.yzznl.cn/archives/36.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>常用的CSS单位</title>
		<link>http://www.yzznl.cn/archives/10.html</link>
		<comments>http://www.yzznl.cn/archives/10.html#comments</comments>
		<pubDate>Thu, 08 Jan 2009 08:00:47 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[Css]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/archives/10.html</guid>
		<description><![CDATA[国内大多数站点都采用px作为字体的单位，当然也包括园子的网站。而国外的一些主流英文站点，几乎都在使用em作为字体单位，你了解不同的单位分别代表什么意义吗？除了px像素单位以外，css还提供了许多其他类型的数学单位，下面将我目前所了解到的总结一下。 px 像素（Pixel）。相对长度单位。像素是相对于显示器屏幕分辨率而言的。譬如，WONDOWS的用户所使用的分辨率一般是96像素/英寸。而MAC的用户所使用的分辨率一般是72像素/英寸。 em 相对长度单位。相对于当前对象内文本的字体尺寸。如当前对行内文本的字体尺寸未被人为设置，则相对于浏览器的默认字体尺寸。em单位有如下特点： em的值并不是固定的； em会继承父级元素的字体大小。 pt 点（Point）。绝对长度单位。 ex 相对长度单位。相对于字符“x”的高度。此高度通常为字体尺寸的一半。如当前对行内文本的字体尺寸未被人为设置，则相对于浏览器的默认字体尺寸。 em到px的单位转换 em指字体高，任意浏览器的默认字体高都是16px。所以未经调整的浏览器都符合: 1em=16px。那么12px=0.75em, 10px=0.625em。为了简化font-size的换算，需要在css中的body选择器中声明Font-size=62.5%，这就使em值变为16px*62.5%=10px, 这样12px=1.2em, 10px=1em, 也就是说只需要将你的原来的px数值除以10，然后换上em作为单位就行了。 上例的单位转换中，12px汉字例外，就是由以上方法得到的12px(1.2em)大小的汉字在IE中并不等于直接用12px定义的字体大小，而是稍大一点。这个问题园子已经解决，只需在body选择器中把62.5%换成63%就能正常显示了。原因可能是IE处理汉字时，对于浮点的取值精确度有限吧。 上面列举的数值单位大部分在网页设计中经常会使用到，对于设计者而言，园子建议你为了便于统一于修改，在某一类型的单位上使用同一的数学单位，如字体大小，定义DIV的宽度和高度等。最好是某一个网站中，根据人们的阅读习惯，统一使用px或pt等来定义。 需要注意的一些问题 IE无法调整那些使用px作为单位的字体大小; 国外的大部分网站能够调整的原因在于其使用了em作为字体单位; Firefox能够调整px和em，但是96%以上的中国网民使用IE浏览器(或内核)。 扩展阅读用 CSS 实现网页的翻转效果 (38)有时候我们需要给用户一点惊喜，一些与众不同。当你访问一个网站的时候发现网站的整个界面都是水平...CSS专题之精华文章汇总 (7)Cascading Style Sheets（层叠样式表），简写为CSS，由W3C定义和维护...CSS中巧用 nowrap 属性禁止文字自动换行 (3)设计页面的时候，我们往往需要把内容在一行里面显示，也就是禁止让文字自动换行，首先来看下下面的...CSS Hack 汇总 (2)什么是 CSS Hack ？ 由于不同的浏览器，比如 IE6.0，IE7.0，IE8....id与class的使用原则 (3)在前面的文章里园子主要与大家分享了CSS的入门知识以及CSS技巧汇总。在用CSS来控制网页布...CSS入门知识 (1)我们首先要了解下面几点关于CSS方面的必备常识： CSS是Cascading S...如何优化CSS文件 (4)尽管现在的网络质量日新月异的发展着，但做为网页设计者还是非常在意网站的交互速度。我们都知道，...用CSS做的几个漂亮按钮 (0)你是否发现有些网站制作的按钮非常漂亮，而且还不是使用PS做的图片，这是怎么做到的呢？今天园子...CSS布局命名规则 (1)近半年来园子一直试着遵循WEB标准设计和制作网页，今天花些时间整理一下在布局过程中会频繁用到...css语法结构 (0)css的语法结构由三部分组成：选择符（Selector）、属性（property）、和值（v...<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="table转div工具：Table2CSS Converter汉化版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftable2css-converter.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F10.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4290804.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">table转div工具：Table2CSS Converter汉化版下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2Fcss-skills-summary.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F10.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS技巧汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F81.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F10.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS入门知识</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F74.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F10.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">如何优化CSS文件</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F36.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F10.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS布局命名规则</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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>国内大多数站点都采用px作为字体的单位，当然也包括<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/about" title="园子" rel="nofollow">园子</a></span>的网站。而国外的一些主流英文站点，几乎都在使用em作为字体单位，你了解不同的单位分别代表什么意义吗？除了px像素单位以外，<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/css" title="css">css</a></span>还提供了许多其他类型的数学单位，下面将我目前所了解到的总结一下。<br />
<span id="more-31362"></span></p>
<ul>
<li><strong>px<br />
</strong>像素（Pixel）。相对长度单位。像素是相对于显示器屏幕分辨率而言的。譬如，WONDOWS的用户所使用的分辨率一般是96像素/英寸。而MAC的用户所使用的分辨率一般是72像素/英寸。</li>
<li><strong>em<br />
</strong>相对长度单位。相对于当前对象内文本的字体尺寸。如当前对行内文本的字体尺寸未被人为设置，则相对于浏览器的默认字体尺寸。em单位有如下特点：</p>
<ol>
<li>em的值并不是固定的；</li>
<li>em会继承父级元素的字体大小。</li>
</ol>
</li>
<li><strong>pt<br />
</strong>点（Point）。绝对长度单位。</li>
<li><strong>ex<br />
</strong>相对长度单位。相对于字符“x”的高度。此高度通常为字体尺寸的一半。如当前对行内文本的字体尺寸未被人为设置，则相对于浏览器的默认字体尺寸。</li>
</ul>
<p><strong>em到px的单位转换<br />
</strong>em指字体高，任意浏览器的默认字体高都是16px。所以未经调整的浏览器都符合: 1em=16px。那么12px=0.75em, 10px=0.625em。为了简化font-size的换算，需要在css中的body选择器中声明Font-size=62.5%，这就使em值变为16px*62.5%=10px, 这样12px=1.2em, 10px=1em, 也就是说只需要将你的原来的px数值除以10，然后换上em作为单位就行了。</p>
<p>上例的单位转换中，12px汉字例外，就是由以上方法得到的12px(1.2em)大小的汉字在IE中并不等于直接用12px定义的字体大小，而是稍大一点。这个问题园子已经解决，只需在body选择器中把62.5%换成63%就能正常显示了。原因可能是IE处理汉字时，对于浮点的取值精确度有限吧。</p>
<p>上面列举的数值单位大部分在网页设计中经常会使用到，对于设计者而言，园子建议你为了便于统一于修改，在某一类型的单位上使用同一的数学单位，如字体大小，定义DIV的宽度和高度等。最好是某一个网站中，根据人们的阅读习惯，统一使用px或pt等来定义。</p>
<p><strong>需要注意的一些问题</strong></p>
<ol>
<li>IE无法调整那些使用px作为单位的字体大小;</li>
<li>国外的大部分网站能够调整的原因在于其使用了em作为字体单位;</li>
<li>Firefox能够调整px和em，但是96%以上的中国网民使用IE浏览器(或内核)。</li>
</ol>
<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/flip-page.html" title="用 CSS 实现网页的翻转效果">用 CSS 实现网页的翻转效果</a> (38)<br /><small>有时候我们需要给用户一点惊喜，一些与众不同。当你访问一个网站的时候发现网站的整个界面都是水平...</small></li><li><a href="http://www.yzznl.cn/archives/223.html" title="CSS专题之精华文章汇总">CSS专题之精华文章汇总</a> (7)<br /><small>Cascading Style Sheets（层叠样式表），简写为CSS，由W3C定义和维护...</small></li><li><a href="http://www.yzznl.cn/archives/201.html" title="CSS中巧用 nowrap 属性禁止文字自动换行">CSS中巧用 nowrap 属性禁止文字自动换行</a> (3)<br /><small>设计页面的时候，我们往往需要把内容在一行里面显示，也就是禁止让文字自动换行，首先来看下下面的...</small></li><li><a href="http://www.yzznl.cn/archives/200.html" title="CSS Hack 汇总">CSS Hack 汇总</a> (2)<br /><small>什么是 CSS Hack ？

由于不同的浏览器，比如 IE6.0，IE7.0，IE8....</small></li><li><a href="http://www.yzznl.cn/archives/108.html" title="id与class的使用原则">id与class的使用原则</a> (3)<br /><small>在前面的文章里园子主要与大家分享了CSS的入门知识以及CSS技巧汇总。在用CSS来控制网页布...</small></li><li><a href="http://www.yzznl.cn/archives/81.html" title="CSS入门知识">CSS入门知识</a> (1)<br /><small>我们首先要了解下面几点关于CSS方面的必备常识：


	CSS是Cascading S...</small></li><li><a href="http://www.yzznl.cn/archives/74.html" title="如何优化CSS文件">如何优化CSS文件</a> (4)<br /><small>尽管现在的网络质量日新月异的发展着，但做为网页设计者还是非常在意网站的交互速度。我们都知道，...</small></li><li><a href="http://www.yzznl.cn/archives/73.html" title="用CSS做的几个漂亮按钮">用CSS做的几个漂亮按钮</a> (0)<br /><small>你是否发现有些网站制作的按钮非常漂亮，而且还不是使用PS做的图片，这是怎么做到的呢？今天园子...</small></li><li><a href="http://www.yzznl.cn/archives/36.html" title="CSS布局命名规则">CSS布局命名规则</a> (1)<br /><small>近半年来园子一直试着遵循<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="WEB标准">WEB标准</a></span>设计和制作网页，今天花些时间整理一下在布局过程中会频繁用到...</small></li><li><a href="http://www.yzznl.cn/archives/9.html" title="css语法结构">css语法结构</a> (0)<br /><small>css的语法结构由三部分组成：选择符（Selector）、属性（property）、和值（v...</small></li></ul><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="table转div工具：Table2CSS Converter汉化版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftable2css-converter.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F10.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/site_images/2011/03/26/4290804.jpg" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">table转div工具：Table2CSS Converter汉化版下载</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2Fcss-skills-summary.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F10.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS技巧汇总</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F81.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F10.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS入门知识</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F74.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F10.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">如何优化CSS文件</font>
                    </a>
                </td>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !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%2Fwww.yzznl.cn%2Farchives%2F36.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F10.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DCE3E9 !important; width: 100px !important; height: 100px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="100px" height="100px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 106px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS布局命名规则</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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://www.yzznl.cn/archives/10.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

