<?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; Xhtml</title>
	<atom:link href="http://www.yzznl.cn/tag/xhtml/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>详解rel=”nofollow”的用法与意义</title>
		<link>http://www.yzznl.cn/archives/225.html</link>
		<comments>http://www.yzznl.cn/archives/225.html#comments</comments>
		<pubDate>Tue, 02 Jun 2009 02:15:35 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[Xhtml]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/?p=40941</guid>
		<description><![CDATA[近年来在网站的链接中我们经常会看到类似rel=”nofollow”或rel=”external nofollow”的属性定义，有很多朋友并不明白它们的语义，今天园子就详细给大家分析一下rel 这个属性在网页中的用法。 rel 属性是用来说明链接和包含此链接页面的关系，以及链接打开的目标。它有许多的属性值，比如next、previous,、chapter、section等等。我们现在比较长见的是rel=”external nofollow”与rel=”nofollow”两种参数的应用。 首先来说下Nofollow “Nofollow”向网站管理员提供了一种方式，即告诉搜索引擎”不要追踪此网页上的链接”或”不要追踪此特定链接“。 最初，nofollow 属性出现在网页级元标记中，指示搜索引擎不要追踪（即抓取）网页上的所有外向链接。 例如： 1 &#60;meta name=&#34;robots&#34; content=&#34;nofollow&#34; /&#62; 或者您可以这样用： 1 &#60;a href=&#34;signin.php&#34; rel=&#34;nofollow&#34;&#62;用户注册&#60;/a&#62; 再来说说external nofollow rel=”external nofollow”只是更相对于rel=”nofollow”参数更加规范一些。rel=”external nofollow”与rel=”nofollow”其功能就中文译文”不要读取” 及”外部链接不要读取“,就已说得很清楚了。其实rel=”external”只是一个替代target=”_blank” 的属性。target=”_blank” 的属性是打开新窗口。但有些博客因为是采用严格的DOCTYPE声名的，如果你打开网站的源代码，在第一行的位置就可以看到： 1 &#60; !DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Strict//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&#34;&#62; 在这种情况下target=”_blank”可能会失效，因此采用rel=”external”这个参数来替代，因此我们可以明白rel=”external”的属性只是打开新窗口的作用。 通过上面的说明您应该明白在何种情况下可以考虑使用nofollow了吧？以下列出经常用到nofollow的几种情况： 不可信赖的内容 付费链接 按优先级别进行抓取 更多可以参见 GOOGLE 的官方文档。 扩展阅读网页中表单的使用技巧 (0)本文园子总结了在网页常用布局中表单的一些使用技巧，可以帮助你更灵活的控制表单，使页面更加人性...语义化表单里的标签 (0)表单是用户提交信息的重要渠道，是(X)HTML的一个重要部分。表单主要用于采集和提交用户输入...丰富表格里的标签 (1)表格，一个在网页设计中比较经典的工具。曾经，表格是网页设计人最重要的布局排版手段，但是它的存...定义列表dl,dt,dd的用法 (2)上篇文章给大家分享了无序列表和有序列表的用法，其实一般我们在做列表的时候通常只会用到ul和l...无序列表和有序列表的用法 (0)首先先来看个截图： 这种以列表形式来显示的内容在网页中称为列表，相信大家都经常...h1~h6的使用原则 (2)在遵循网页标准制作网页的时候，为了使得设计更具有语义化，我们经常会在页面中用到h1~h6的标...以图换字方法和思路 [...]<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="为 WordPress 的阅读全文链接加上 nofollow" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fwordpress-nofollow.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F225.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;">为 WordPress 的阅读全文链接加上 nofollow</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="Nofollow 标签的语义和使用" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F161.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F225.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;">Nofollow 标签的语义和使用</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="网页设计中如何避免 IE 浏览器图片下方的空隙" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F384.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F225.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/4290983.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;">网页设计中如何避免 IE 浏览器图片下方的空隙</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="园子博客谷歌反向链接达到81个" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fgardenblog-google-backlinks.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F225.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/4291174.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;">园子博客谷歌反向链接达到81个</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%2Fdeng-yu.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F225.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/11/30/11708340.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>
        </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>rel=”nofollow”</strong>或<strong>rel=”external nofollow”</strong>的属性定义，有很多朋友并不明白它们的语义，今天<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/about" title="园子" rel="nofollow">园子</a></span>就详细给大家分析一下rel 这个属性在网页中的用法。</p>
<p>rel 属性是用来说明<strong>链接和包含此链接页面的关系，以及链接打开的目标</strong>。它有许多的属性值，比如next、previous,、chapter、section等等。我们现在比较长见的是rel=”external nofollow”与rel=”nofollow”两种参数的应用。<br />
<span id="more-40941"></span></p>
<h4>首先来说下Nofollow</h4>
<p>“Nofollow”向网站管理员提供了一种方式，即告诉搜索引擎”<strong>不要追踪此网页上的链接”</strong>或”<strong>不要追踪此特定链接</strong>“。 最初，nofollow 属性出现在网页级元标记中，指示搜索引擎不要追踪（即抓取）网页上的所有外向链接。 例如：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;meta name=&quot;robots&quot; content=&quot;nofollow&quot; /&gt;</pre></td></tr></table></div>

<p>或者您可以这样用：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;a href=&quot;signin.php&quot; rel=&quot;nofollow&quot;&gt;用户注册&lt;/a&gt;</pre></td></tr></table></div>

<h4>再来说说external nofollow</h4>
<p>rel=”external nofollow”只是更相对于rel=”nofollow”参数更加规范一些。rel=”external nofollow”与rel=”nofollow”其功能就中文译文”<strong>不要读取</strong>” 及”<strong>外部链接不要读取</strong>“,就已说得很清楚了。其实rel=”external”只是一个替代target=”_blank” 的属性。target=”_blank” 的属性是打开新窗口。但有些博客因为是采用严格的DOCTYPE声名的，如果你打开网站的源代码，在第一行的位置就可以看到：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt; !DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</pre></td></tr></table></div>

<p>在这种情况下target=”_blank”可能会失效，因此采用rel=”external”这个参数来替代，因此我们可以明白rel=”external”的属性只是打开新窗口的作用。</p>
<p>通过上面的说明您应该明白在何种情况下可以考虑使用nofollow了吧？以下列出经常用到nofollow的几种情况：</p>
<ul>
<li>不可信赖的内容</li>
<li>付费链接</li>
<li>按优先级别进行抓取</li>
</ul>
<p>更多可以参见 GOOGLE 的<a href="http://www.google.com/support/webmasters/bin/answer.py?hl=cn&amp;answer=33581">官方文档</a>。</p>
<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/72.html" title="网页中表单的使用技巧">网页中表单的使用技巧</a> (0)<br /><small>本文园子总结了在网页常用布局中表单的一些使用技巧，可以帮助你更灵活的控制表单，使页面更加人性...</small></li><li><a href="http://www.yzznl.cn/archives/71.html" title="语义化表单里的标签">语义化表单里的标签</a> (0)<br /><small>表单是用户提交信息的重要渠道，是(X)HTML的一个重要部分。表单主要用于采集和提交用户输入...</small></li><li><a href="http://www.yzznl.cn/archives/70.html" title="丰富表格里的标签">丰富表格里的标签</a> (1)<br /><small>表格，一个在网页设计中比较经典的工具。曾经，表格是网页设计人最重要的布局排版手段，但是它的存...</small></li><li><a href="http://www.yzznl.cn/archives/69.html" title="定义列表dl,dt,dd的用法">定义列表dl,dt,dd的用法</a> (2)<br /><small>上篇文章给大家分享了无序列表和有序列表的用法，其实一般我们在做列表的时候通常只会用到ul和l...</small></li><li><a href="http://www.yzznl.cn/archives/68.html" title="无序列表和有序列表的用法">无序列表和有序列表的用法</a> (0)<br /><small>首先先来看个截图：



这种以列表形式来显示的内容在网页中称为列表，相信大家都经常...</small></li><li><a href="http://www.yzznl.cn/archives/67.html" title="h1~h6的使用原则">h1~h6的使用原则</a> (2)<br /><small>在遵循<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="网页标准">网页标准</a></span>制作网页的时候，为了使得设计更具有语义化，我们经常会在页面中用到h1~h6的标...</small></li><li><a href="http://www.yzznl.cn/archives/66.html" title="以图换字方法和思路">以图换字方法和思路</a> (2)<br /><small>不知道您在做网站时有没有遇到过这样的问题：想保留链接的背景，但又要链接里的文字消失！可是弄了...</small></li><li><a href="http://www.yzznl.cn/archives/65.html" title="一些少用的XHTML标签">一些少用的XHTML标签</a> (0)<br /><small>在我们的实际应用中，还有一些<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/xhtml" title="xhtml">xhtml</a></span>标签是不太常用的，今天园子把使用频率较少但又有些代表性...</small></li><li><a href="http://www.yzznl.cn/archives/64.html" title="q与cite标签的应用">q与cite标签的应用</a> (1)<br /><small>前面的文章里园子给大家介绍过：strong和em标签的应用，大家知道这两个标签有一些相似之处...</small></li><li><a href="http://www.yzznl.cn/archives/61.html" title="abbr和acronym标签的使用">abbr和acronym标签的使用</a> (2)<br /><small>很多人都喜欢使用缩略词来表述特定的事物或是事件，这样做的好处是方便快递地传达信息，而不用每次...</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="为 WordPress 的阅读全文链接加上 nofollow" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fwordpress-nofollow.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F225.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;">为 WordPress 的阅读全文链接加上 nofollow</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="Nofollow 标签的语义和使用" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F161.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F225.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;">Nofollow 标签的语义和使用</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="平衡球（Ballance）关口全开补丁下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fballance-mark-patch-download.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F225.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/4289978.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;">平衡球（Ballance）关口全开补丁下载</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%2F440.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F225.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/02/01/14602220.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="网页设计中如何避免 IE 浏览器图片下方的空隙" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F384.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F225.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/4290983.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;">网页设计中如何避免 IE 浏览器图片下方的空隙</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/225.html/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>网页中表单的使用技巧</title>
		<link>http://www.yzznl.cn/archives/72.html</link>
		<comments>http://www.yzznl.cn/archives/72.html#comments</comments>
		<pubDate>Sat, 28 Feb 2009 09:34:33 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[网站应用]]></category>
		<category><![CDATA[Xhtml]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/archives/72.html</guid>
		<description><![CDATA[本文园子总结了在网页常用布局中表单的一些使用技巧，可以帮助你更灵活的控制表单，使页面更加人性化。 1、表单文本输入的移动选择 在文本输入栏中，如果加入了提示，来访者往往要用鼠标选取后删除，再输入有用的信息。其实只要加入onMouseOver=”this.focus()” onFocus=”this.select()” 代码到 &#60;textarea&#62; 中，一切就会变得简单多了，如： &#60;textarea name=textarea wrap=virtual rows=2 cols=22 onMouseOver=”this.focus()” onFocus=”this.select()”&#62;Input English..&#60;/textarea&#62; 类似的，可以加入代码到&#60;input&#62;。 2、表单输入单元点击删除 本列同上则作用类似，只是使用鼠标上略有变化，需要点击而不像上则的只要鼠标覆盖。如： &#60;input type=text name=”address” size=19 value=”Enter,e-mail&#8230;”onFocus=”this.value=””&#62; 点击输入单元后，提示信息会删除，是不是很方便。 3、表单输入单元的边框设置 更改传统的表单单元边框，会让你的主页生色不少。如： &#60;input type=radio name=action value=subscribe checked style=”BORDER-BOTTOM: dashed 1px; BORDER-LEFT: dashed 1px; BORDER-RIGHT: dashed 1px; BORDER-TOP: dashed 1px;background-color: #FEF5C8&#8243;&#62; 其中”style=***”为左右上下和背景色设置，适用于其它单元，请读者亲自试试。 4、表单输入单元的文字设置 表单中单元的字体是可以修改的，如： &#60;input type=text name=”address” size=19 value=”Enter,e-mail&#8230;” style=font-family:”verdana”;font-size:10px &#62; 其中”style=***”为字体和字大小设置。 [...]<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="网页标题优化的八个技巧" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F62.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F72.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="用 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%2F72.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>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="WordPress 技巧：更新时只更新核心文件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fwp-update.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F72.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/12/08/12058402.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;">WordPress 技巧：更新时只更新核心文件</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%2Fnewline-characters-force.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F72.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/4290913.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="更新网站的技巧" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fupdate-site-skills.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F72.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>
        </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>总结了在网页常用布局中表单的一些使用技巧，可以帮助你更灵活的控制表单，使页面更加人性化。</p>
<p>1、<strong>表单文本输入的移动选择</strong></p>
<p>在文本输入栏中，如果加入了提示，来访者往往要用鼠标选取后删除，再输入有用的信息。其实只要加入onMouseOver=”this.focus()” onFocus=”this.select()” 代码到 &lt;textarea&gt; 中，一切就会变得简单多了，如：</p>
<p><font color="#0099cc">&lt;textarea name=textarea wrap=virtual rows=2 cols=22 onMouseOver=”this.focus()” onFocus=”this.select()”&gt;Input English..&lt;/textarea&gt; </font></p>
<p>类似的，可以加入代码到&lt;input&gt;。<br />
<span id="more-35332"></span></p>
<p>2、<strong>表单输入单元点击删除</strong></p>
<p>本列同上则作用类似，只是使用鼠标上略有变化，需要点击而不像上则的只要鼠标覆盖。如：</p>
<p><font color="#0099cc">&lt;input type=text name=”address” size=19 value=”Enter,e-mail&#8230;”onFocus=”this.value=””&gt;</font></p>
<p>点击输入单元后，提示信息会删除，是不是很方便。</p>
<p>3、<strong>表单输入单元的边框设置</strong></p>
<p>更改传统的表单单元边框，会让你的主页生色不少。如：</p>
<p><font color="#0099cc">&lt;input type=radio name=action value=subscribe checked style=”BORDER-BOTTOM: dashed 1px; BORDER-LEFT: dashed 1px; BORDER-RIGHT: dashed 1px; BORDER-TOP: dashed 1px;background-color: #FEF5C8&#8243;&gt;</font></p>
<p>其中”style=***”为左右上下和背景色设置，适用于其它单元，请读者亲自试试。</p>
<p>4、<strong>表单输入单元的文字设置</strong></p>
<p>表单中单元的字体是可以修改的，如：</p>
<p><font color="#0099cc">&lt;input type=text name=”address” size=19 value=”Enter,e-mail&#8230;” style=font-family:”verdana”;font-size:10px &gt;</font></p>
<p>其中”style=***”为字体和字大小设置。</p>
<p>5、<strong>修改表单属性为弹出窗口</strong></p>
<p>大多数表单激活后，会在当前页面中打开，影响正常浏览。不如修改一下，如：</p>
<p><font color="#0099cc">&lt;form method=POST action=url target=_blank&gt;</font></p>
<p>其中”target=_blank”为控制在弹出窗口打开。</p>
<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/225.html" title="详解rel=”nofollow”的用法与意义">详解rel=”nofollow”的用法与意义</a> (9)<br /><small>近年来在网站的链接中我们经常会看到类似rel="nofollow"或rel="externa...</small></li><li><a href="http://www.yzznl.cn/archives/71.html" title="语义化表单里的标签">语义化表单里的标签</a> (0)<br /><small>表单是用户提交信息的重要渠道，是(X)HTML的一个重要部分。表单主要用于采集和提交用户输入...</small></li><li><a href="http://www.yzznl.cn/archives/70.html" title="丰富表格里的标签">丰富表格里的标签</a> (1)<br /><small>表格，一个在网页设计中比较经典的工具。曾经，表格是网页设计人最重要的布局排版手段，但是它的存...</small></li><li><a href="http://www.yzznl.cn/archives/69.html" title="定义列表dl,dt,dd的用法">定义列表dl,dt,dd的用法</a> (2)<br /><small>上篇文章给大家分享了无序列表和有序列表的用法，其实一般我们在做列表的时候通常只会用到ul和l...</small></li><li><a href="http://www.yzznl.cn/archives/68.html" title="无序列表和有序列表的用法">无序列表和有序列表的用法</a> (0)<br /><small>首先先来看个截图：



这种以列表形式来显示的内容在网页中称为列表，相信大家都经常...</small></li><li><a href="http://www.yzznl.cn/archives/67.html" title="h1~h6的使用原则">h1~h6的使用原则</a> (2)<br /><small>在遵循<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="网页标准">网页标准</a></span>制作网页的时候，为了使得设计更具有语义化，我们经常会在页面中用到h1~h6的标...</small></li><li><a href="http://www.yzznl.cn/archives/66.html" title="以图换字方法和思路">以图换字方法和思路</a> (2)<br /><small>不知道您在做网站时有没有遇到过这样的问题：想保留链接的背景，但又要链接里的文字消失！可是弄了...</small></li><li><a href="http://www.yzznl.cn/archives/65.html" title="一些少用的XHTML标签">一些少用的XHTML标签</a> (0)<br /><small>在我们的实际应用中，还有一些<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/xhtml" title="xhtml">xhtml</a></span>标签是不太常用的，今天园子把使用频率较少但又有些代表性...</small></li><li><a href="http://www.yzznl.cn/archives/64.html" title="q与cite标签的应用">q与cite标签的应用</a> (1)<br /><small>前面的文章里园子给大家介绍过：strong和em标签的应用，大家知道这两个标签有一些相似之处...</small></li><li><a href="http://www.yzznl.cn/archives/61.html" title="abbr和acronym标签的使用">abbr和acronym标签的使用</a> (2)<br /><small>很多人都喜欢使用缩略词来表述特定的事物或是事件，这样做的好处是方便快递地传达信息，而不用每次...</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="网页标题优化的八个技巧" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F62.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F72.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="用 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%2F72.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>
                <td width="106" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DCE3E9 !important;">
                    <a target="_blank" title="WordPress 技巧：更新时只更新核心文件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fwp-update.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F72.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/12/08/12058402.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;">WordPress 技巧：更新时只更新核心文件</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%2Fnewline-characters-force.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F72.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/4290913.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="更新网站的技巧" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fupdate-site-skills.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F72.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>
        </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/72.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>语义化表单里的标签</title>
		<link>http://www.yzznl.cn/archives/71.html</link>
		<comments>http://www.yzznl.cn/archives/71.html#comments</comments>
		<pubDate>Fri, 27 Feb 2009 02:30:55 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[Xhtml]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/archives/71.html</guid>
		<description><![CDATA[表单是用户提交信息的重要渠道，是(X)HTML的一个重要部分。表单主要用于采集和提交用户输入的信息，我们经常会用到表单，那么你明白表单里的每个标签的正确语义吗？今天园子给大家分享一下表单里一些常用标签的使用方法。 form标签的使用 form是用于申明表单，定义采集数据的范围，也就是&#60;form&#62;和&#60;/form&#62;里面包含的数据将被提交到服务器或者电子邮件里。 fieldset &#38; legend标签的使用 fieldset用于对表单中的元素进行分组，而在&#60;fieldset&#62;这个组内，&#60;legend&#62;就是它的标题，用于描述&#60;fieldset&#62;所包含的内容。一般可视化浏览器把&#60;fieldset&#62;渲染为带边框的，&#60;legend&#62;一般显示在左上角。要注意的一点是，&#60;legend&#62;元素必须是&#60;fieldset&#62;内的第一个元素，否则&#60;legend&#62;前面的内容将出现在&#60;fieldset&#62;前面，而不是在里面。 fieldset元素不仅仅适用于大块的内容分组，也可以用于选项的分组，就像这样： 1 2 3 4 5 6 7 &#60;fieldset&#62; &#60;legend&#62;个人爱好&#60;/legend&#62; &#60;input type=”checkbox” id=”likeSleep” name=”like”/&#62; &#60;label for=”likeSleep”&#62;睡觉&#60;/label&#62; &#60;input type=”checkbox” id=”likeEat” name=”like” /&#62; &#60;label for=”likeEat”&#62;吃饭&#60;/label&#62; &#60;/fieldset&#62; 效果如下图所示： 当然，这只是最初的样式，我们可以通过css重新定义它的外观。 label标签的使用 HTML 4.0引入了label对象，你可以使用它将文本与其他任何(X)HTML对象或内部控件关联。无论用户单击&#60;label&#62;或者(X)HTML 对象，被链接的&#60;label&#62;和(X)HTML对象在引发和接收事件时行为一致，而要连接&#60;label&#62;和(X)HTML对象的方式是：将&#60;label&#62;的for属性设置为要关联的(X)HTML对象的id属性。例如： &#60;label for=”username”&#62;用户：&#60;/label&#62;&#60;input type=”text” id=”username” name=”username” /&#62; 当用户单击&#60;label&#62;内的文本（用户：）时，&#60;label&#62;会将焦点设置到文本框。 &#60;label&#62;主要是给表单组件增加可访问性设计的，一般我们都把 label 用在表单里。除以上方法，还可以直接用 label 套嵌整个表单组件和文本标签，例如下面的例子： 1 2 &#60;label for=”likeSleep”&#62;&#60;input type=”checkbox” id=”likeSleep” [...]<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="河南联通（网通）、电信、铁通最新 DNS 服务器地址" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fhenan-unicom-telecom-dns.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F71.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/4290094.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;">河南联通（网通）、电信、铁通最新 DNS 服务器地址</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="祝贺园子博客文章总数达到500篇" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fyzznl-500-articles.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F71.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/4291713.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;">祝贺园子博客文章总数达到500篇</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%2Ftianmao.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F71.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/11/13804039.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="3月20日郑州沙尘暴实拍" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F390.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F71.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/4292075.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;">3月20日郑州沙尘暴实拍</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="腾讯与360战争继续升级" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftencent-360-war.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F71.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/4291496.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;">腾讯与360战争继续升级</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>表单是用户提交信息的重要渠道，是(X)HTML的一个重要部分。表单主要用于采集和提交用户输入的信息，我们经常会用到表单，那么你明白表单里的每个标签的正确语义吗？今天<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/about" title="园子" rel="nofollow">园子</a></span>给大家分享一下表单里一些常用标签的使用方法。</p>
<h4>form标签的使用</h4>
<p>form是用于申明表单，定义采集数据的范围，也就是&lt;form&gt;和&lt;/form&gt;里面包含的数据将被提交到服务器或者电子邮件里。<br />
<span id="more-35261"></span></p>
<h4>fieldset &amp; legend标签的使用</h4>
<p>fieldset用于对表单中的元素进行分组，而在&lt;fieldset&gt;这个组内，&lt;legend&gt;就是它的标题，用于描述&lt;fieldset&gt;所包含的内容。一般可视化浏览器把&lt;fieldset&gt;渲染为带边框的，&lt;legend&gt;一般显示在左上角。要注意的一点是，&lt;legend&gt;元素必须是&lt;fieldset&gt;内的第一个元素，否则&lt;legend&gt;前面的内容将出现在&lt;fieldset&gt;前面，而不是在里面。<br />
fieldset元素不仅仅适用于大块的内容分组，也可以用于选项的分组，就像这样：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;fieldset&gt;
&lt;legend&gt;个人爱好&lt;/legend&gt;
&lt;input type=”checkbox” id=”likeSleep” name=”like”/&gt;
&lt;label for=”likeSleep”&gt;睡觉&lt;/label&gt;
&lt;input type=”checkbox” id=”likeEat” name=”like” /&gt;
&lt;label for=”likeEat”&gt;吃饭&lt;/label&gt;
&lt;/fieldset&gt;</pre></td></tr></table></div>

<p>效果如下图所示：</p>
<p><img src="http://www.yzznl.cn/wp-content/uploads/2009/02/form_1.gif" alt="form_1.gif" /></p>
<p>当然，这只是最初的样式，我们可以通过<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/css" title="css">css</a></span>重新定义它的外观。</p>
<h4>label标签的使用</h4>
<p>HTML 4.0引入了label对象，你可以使用它将文本与其他任何(X)HTML对象或内部控件关联。无论用户单击&lt;label&gt;或者(X)HTML 对象，被链接的&lt;label&gt;和(X)HTML对象在引发和接收事件时行为一致，而要连接&lt;label&gt;和(X)HTML对象的方式是：将&lt;label&gt;的for属性设置为要关联的(X)HTML对象的id属性。例如：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;label for=”username”&gt;用户：&lt;/label&gt;&lt;input type=”text” id=”username” name=”username” /&gt;</pre></div></div>

<p>当用户单击&lt;label&gt;内的文本（用户：）时，&lt;label&gt;会将焦点设置到文本框。<br />
&lt;label&gt;主要是给表单组件增加可访问性设计的，一般我们都把 label 用在表单里。除以上方法，还可以直接用 label 套嵌整个表单组件和文本标签，例如下面的例子：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;label for=”likeSleep”&gt;&lt;input type=”checkbox” id=”likeSleep” name=”like”/&gt;睡觉&lt;/label&gt;
&lt;label for=”likeEat”&gt;&lt;input type=”checkbox” id=”likeEat” name=”like” /&gt;吃饭&lt;/label&gt;</pre></td></tr></table></div>

<p>下图左边为单击“睡觉”在Firefox下选中复选框的，右边是在IE下的截图，注意虚线框的不同。</p>
<p><img src="http://www.yzznl.cn/wp-content/uploads/2009/02/form_2.gif" alt="form_2.gif" /></p>
<h4>input标签的使用</h4>
<p>这个是在表单里应用得最多的一个标签，一个由属性值来决定标签的意义的标签。基本结构是：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;input type=”…” id=”…” name=”…” value=”…” /&gt;</pre></div></div>

<p>文本框是一种让访问者自己输入内容的表单对象，通常被用来填写单个字或者简短的回答，如姓名、地址等。下面列举了一些input常用的几种类型。</p>
<ul>
<li><strong>type=”password”<br />
</strong>密码输入框是一种特殊的文本域，用于输入密码。当访问者输入文字时，文字会被“*”代替，而输入的文字会被隐藏。</li>
<li><strong>type=”checkbox”<br />
</strong>复选框复选框允许在待选项中选中一项以上的选项。</li>
<li><strong>type=”radio”<br />
</strong>单选框当需要访问者在待选项中选择唯一的答案时，就需要用到单选框了。</li>
<li><strong>type=”file”</strong><br />
文件上传框有时候，需要用户上传自己的文件，文件上传框看上去和其它文本域差不多，只是它还包含了一个浏览按钮（语言是中文的浏览器）。</li>
<li><strong>type=”hidden”</strong><br />
隐藏域元素不会显示在文档里，所以用户也无法操作该元素。该元素通常用来传输一些客户端到服务器的状态信息。虽然此元素不会显示出来，但是用户通过查看 (X)HTML 的源代码还是可以看到该元素属性的值，所以请注意，不要用该元素传递敏感信息，例如密码。</li>
<li><strong>type=”image”</strong><br />
创建一个图像控件，该控件单击后将导致表单立即被提交，并且会提交点击该元素的坐标，例如：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;input type=”image” name=”test” src=”test.gif” mce_src=”test.gif” /&gt;</pre></div></div>

<p>将把x坐标以test.x 、y 坐标以test.y提交，就是在name后面加个.x和.y组成两个新的name，value的任何属性值都将被忽略，src 属性指定了img元素。</li>
<li><strong>type=”button”</strong><br />
这是一个普通的按钮，它的值并不会提交，而是显示在按钮上，如果没有通过JavaScript给其添加操作时，它将是个普通的可视元素。</li>
<li><strong>type=”submit”</strong><br />
提交按钮，将表单（Form）里的信息提交给表单里action属性所指向的地址。如果用户单击提交按钮提交了表单，并且按钮指定了 name 标签属性，那么该按钮也将在提交的数据中。<br />
如果在同一表单中有多个&lt;input type=”submit” …/&gt; 按钮， 按回车键将使用第一个&lt;inputtype=”submit” …/&gt;按钮提交表单，除非此时正有另一个&lt;input type=”submit” ../&gt;按钮获得了焦点。如果另外一个&lt;input type=”submit” &#8230;&gt;按钮已获得焦点，按回车键将使用该&lt;input type=”submit” …&gt;按钮提交表单，为什么有可能是多个提交按钮呢？因为type=”submit”的值也是可以提交的。</li>
<li><strong>type=”reset”<br />
</strong>重置按钮，默认的文字是“重置”。可以通过value属性指定文字。该按钮单击后将重置表单控件为其默认值。</li>
</ul>
<p>在&lt;input&gt;的属性里，name和id并非必须的，name是由表单处理用，而id是给label做连接用，value的显示是因类型而异：type=”text”的直接显示于文本框内；type=”password”的以星号代替value的值；type=”checkbox”、type=”radio”的无法直接在页面上看到；type=”file”的因安全问题，无默认的value，即使你给它添加了value，也会被忽略；type=”hidden”的因为本身已经隐藏，自然也没显示；type=”image”的并无value值，它是由用户点击时实时创建的；type=”button”、type=”submit”、type=”reset”这三种类型的input的value属性指定了显示在按钮上的文字。</p>
<h4>textarea标签的使用</h4>
<p>多行文本输入框，也是一种让访问者自己输入内容的表单对象，接受的内容比单行文本输入框更多。例如：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;textarea id=”…” name=”…” cols=”…” rows=”…” wrap=”…”&gt;多行文本输入框的内容是写在这里面&lt;/textarea&gt;</pre></div></div>

<p>其中cols属性定义多行文本框的宽度，单位是单个字符宽度（注：Firefox默认没有滚动条，所以得到额外的宽度）；rows属性定义多行文本框的高度，单位是单个字符高度（IE浏览器是计算单个字符宽度）；wrap属性定义输入内容大于文本域时显示的方式，可选值如下：</p>
<ul>
<li>默认值是文本自动换行；当输入内容超过文本域的右边界时会自动转到下一行，而数据在被提交处理时自动换行的地方不会有换行符出现；</li>
<li>off，用来避免文本换行，当输入的内容超过文本域右边界时，文本将向左滚动，必须用Return才能将插入点移到下一行；</li>
<li>virtual，允许文本自动换行。当输入内容超过文本域的右边界时会自动转到下一行，而数据在被提交处理时自动换行的地方不会有换行符出现；</li>
<li>physical，让文本换行，当数据被提交处理时换行符也将被一起提交处理。</li>
</ul>
<h4>select &amp; optgroup &amp; option标签的使用</h4>
<p>下拉选择框或列表框，是不是听起来很奇怪呢？没错，&lt;select&gt;也是一个由属性决定表现的，同时，这个属性也是CSS无法代替的，它就是size。例如：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;select id=”…” name=”…” &gt;
&lt;option value=”…”&gt;传说中的测试1&lt;/option&gt;
&lt;option value=”…”&gt;传说中的测试2&lt;/option&gt;
&lt;option value=”…”&gt;传说中的测试3&lt;/option&gt;
&lt;/select&gt;</pre></td></tr></table></div>

<p>效果如图：</p>
<p><img src="http://www.yzznl.cn/wp-content/uploads/2009/02/form_3.gif" alt="form_3.gif" /></p>
<p>这种就是默认的下拉选择框，而给添加了size属性的会是怎样呢？</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;select id=”…” name=”…” size=”4″ &gt;
&lt;option value=”…”&gt;传说中的测试1&lt;/option&gt;
&lt;option value=”…”&gt;传说中的测试2&lt;/option&gt;
&lt;option value=”…”&gt;传说中的测试3&lt;/option&gt;
&lt;/select&gt;</pre></td></tr></table></div>

<p> 效果如图：</p>
<p><img src="http://www.yzznl.cn/wp-content/uploads/2009/02/form_4.gif" alt="form_4.gif" /></p>
<p>这时，&lt;select&gt;变成了列表框，size是决定列表框的行数，当然，我们可以再通过CSS重新定义他的高度。optgroup标签可以给&lt;select&gt;的options分类，需要使用一个label属性，在可视化浏览器里，它的属性值会在下拉列表里显示为一个不可选的标题。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;select id=”…” name=”…”&gt;
&lt;optgroup label=”传说中的分组1″ &gt;
&lt;option value=”…”&gt;传说中的测试1&lt;/option&gt;
&lt;option value=”…”&gt;传说中的测试2&lt;/option&gt;
&lt;optgroup label=”传说中的分组2″ /&gt;
&lt;option value=”…”&gt;传说中的测试3&lt;/option&gt;
&lt;/optgroup&gt;
&lt;/select&gt;</pre></td></tr></table></div>

<p>效果如图： </p>
<p><img src="http://www.yzznl.cn/wp-content/uploads/2009/02/form_5.gif" alt="form_5.gif" /></p>
<p>option就是选择中的内容了，value属性值并不会在浏览器显示，它只是作为提交数据的值。</p>
<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/225.html" title="详解rel=”nofollow”的用法与意义">详解rel=”nofollow”的用法与意义</a> (9)<br /><small>近年来在网站的链接中我们经常会看到类似rel="nofollow"或rel="externa...</small></li><li><a href="http://www.yzznl.cn/archives/72.html" title="网页中表单的使用技巧">网页中表单的使用技巧</a> (0)<br /><small>本文园子总结了在网页常用布局中表单的一些使用技巧，可以帮助你更灵活的控制表单，使页面更加人性...</small></li><li><a href="http://www.yzznl.cn/archives/70.html" title="丰富表格里的标签">丰富表格里的标签</a> (1)<br /><small>表格，一个在网页设计中比较经典的工具。曾经，表格是网页设计人最重要的布局排版手段，但是它的存...</small></li><li><a href="http://www.yzznl.cn/archives/69.html" title="定义列表dl,dt,dd的用法">定义列表dl,dt,dd的用法</a> (2)<br /><small>上篇文章给大家分享了无序列表和有序列表的用法，其实一般我们在做列表的时候通常只会用到ul和l...</small></li><li><a href="http://www.yzznl.cn/archives/68.html" title="无序列表和有序列表的用法">无序列表和有序列表的用法</a> (0)<br /><small>首先先来看个截图：



这种以列表形式来显示的内容在网页中称为列表，相信大家都经常...</small></li><li><a href="http://www.yzznl.cn/archives/67.html" title="h1~h6的使用原则">h1~h6的使用原则</a> (2)<br /><small>在遵循<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="网页标准">网页标准</a></span>制作网页的时候，为了使得设计更具有语义化，我们经常会在页面中用到h1~h6的标...</small></li><li><a href="http://www.yzznl.cn/archives/66.html" title="以图换字方法和思路">以图换字方法和思路</a> (2)<br /><small>不知道您在做网站时有没有遇到过这样的问题：想保留链接的背景，但又要链接里的文字消失！可是弄了...</small></li><li><a href="http://www.yzznl.cn/archives/65.html" title="一些少用的XHTML标签">一些少用的XHTML标签</a> (0)<br /><small>在我们的实际应用中，还有一些<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/xhtml" title="xhtml">xhtml</a></span>标签是不太常用的，今天园子把使用频率较少但又有些代表性...</small></li><li><a href="http://www.yzznl.cn/archives/64.html" title="q与cite标签的应用">q与cite标签的应用</a> (1)<br /><small>前面的文章里园子给大家介绍过：strong和em标签的应用，大家知道这两个标签有一些相似之处...</small></li><li><a href="http://www.yzznl.cn/archives/61.html" title="abbr和acronym标签的使用">abbr和acronym标签的使用</a> (2)<br /><small>很多人都喜欢使用缩略词来表述特定的事物或是事件，这样做的好处是方便快递地传达信息，而不用每次...</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="淘宝网推出看图购 – 像看杂志一样挑选商品" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F180.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F71.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/4293106.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="一键显示或隐藏电脑里的文件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F190.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F71.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/4293068.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="AdSense 常见问题解答" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fadsense-questions.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F71.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/09/16764316.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;">AdSense 常见问题解答</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%2F197.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F71.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/4293020.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="通过 orkut 关注好友的地理位置" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F182.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F71.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/4290306.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;">通过 orkut 关注好友的地理位置</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/71.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>丰富表格里的标签</title>
		<link>http://www.yzznl.cn/archives/70.html</link>
		<comments>http://www.yzznl.cn/archives/70.html#comments</comments>
		<pubDate>Thu, 26 Feb 2009 06:17:40 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[Xhtml]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/archives/70.html</guid>
		<description><![CDATA[表格，一个在网页设计中比较经典的工具。曾经，表格是网页设计人最重要的布局排版手段，但是它的存在其实并不是为了布局，在WEB标准中的表格更不应该用来布局（想了解DIV布局和表格布局的区别的话，请看我以前写的文章：DIV布局和table布局的区别）。相反，对于多维数据，你应该使用table。为了使数据表格有更强的访问性，了解和使用各种构造表格的组件就很重要了。例如表格标题（&#60; caption &#62;）、摘要（summary 属性）和表格头部单元格（&#60;th&#62;）等。今天园子给大家分享的是在表格里经常用到的一些标签的用法。 caption标签的使用 &#60;caption&#62;标签可以为表格提供一个简短的说明，也可以当成标题看待。使用的时候，&#60;caption&#62;标签一定要紧接着开始的&#60;table&#62;标签写，默认情况下，大部分可视化浏览器显示表格标题在表格的上方中央，css里的caption-side属性用来控制表格标题显示的地方，大部分浏览器只能把表格标题显示在表格的上方或者下方，只有少部分浏览器支持左边或者右边。 summary标签的使用 &#60;summary&#62;与&#60;caption&#62;的关系有点像标题与描述一样，不过这个属性的值是不会被可视化浏览器显示。如果我们是用看的方式看表格，基本内容都可以看出来，但是使用屏幕阅读器的人就不是那么容易了，他们必须依赖&#60;caption&#62;和&#60;summary&#62;属性才能相对快速地来了解表格的内容。当然，通过&#60;summary&#62;可以让表格有更多方面的应用，并非仅仅只是为了满足使用屏幕阅读器的人。 tr、th、td标签的使用 &#60;tr&#62;用于指定表格中的一行，而&#60;th&#62;是指标题列，大部分浏览器都会把标题列的内容居中并以粗体显示，&#60;td&#62;才是表格中的单元格。&#60;th&#62;跟&#60;td&#62;这两个都是表格最重要的组成部分，它们必须存在于&#60;tr&#62;的子级，内容都是通过这两者来显示的。 thead、tfoot、tbody标签的使用 表格也一样有很完整的结构，它有分头部、主体部分、底部。在HTML4中，它们早已经存在了，不过一直没什么人使用它，在xhtml的时代，我们更须要学习它。尝试创建一份声明是html4 strict类型的网页，使用这样的表格： 1 2 3 4 5 6 7 8 &#60;table&#62; &#60;tr&#62; &#60;th&#62;头部&#60;/th&#62;&#60;th&#62;头部&#60;/th&#62; &#60;/tr&#62; &#60;tr&#62; &#60;td&#62;内容&#60;/td&#62;&#60;td&#62;内容&#60;/td&#62; &#60;/tr&#62; &#60;/table&#62; 不管是HTML还是XHTML，这几个标签都是提倡使用，非一定要用，但是使用有什么好处呢？园子个人认为有重要的几点是： 减少浏览器为渲染表格时额外的检查及错误的添加，可以加速表格的显示； 保持打印时表格的结构； 可以为CSS提供更多的控制条件等。 有个特别要注意的地方是：它们顺序是&#60;thead&#62;、&#60;tfoot&#62;、&#60;tbody&#62;，先是表格头部跟底部，然后才是表格的主体内容。 colgroup、col标签的使用 有了横向的划分（thead、tfoot、tbody），自然会有纵向的划分。col用于指定基于列的表格默认属性,嵌套的col 属性将覆盖 colgroup属性，而colgroup指定表格中一列或一组列的默认属性。 扩展阅读详解rel=”nofollow”的用法与意义 (9)近年来在网站的链接中我们经常会看到类似rel="nofollow"或rel="externa...网页中表单的使用技巧 (0)本文园子总结了在网页常用布局中表单的一些使用技巧，可以帮助你更灵活的控制表单，使页面更加人性...语义化表单里的标签 (0)表单是用户提交信息的重要渠道，是(X)HTML的一个重要部分。表单主要用于采集和提交用户输入...定义列表dl,dt,dd的用法 (2)上篇文章给大家分享了无序列表和有序列表的用法，其实一般我们在做列表的时候通常只会用到ul和l...无序列表和有序列表的用法 (0)首先先来看个截图： 这种以列表形式来显示的内容在网页中称为列表，相信大家都经常...h1~h6的使用原则 (2)在遵循网页标准制作网页的时候，为了使得设计更具有语义化，我们经常会在页面中用到h1~h6的标...以图换字方法和思路 (2)不知道您在做网站时有没有遇到过这样的问题：想保留链接的背景，但又要链接里的文字消失！可是弄了...一些少用的XHTML标签 (0)在我们的实际应用中，还有一些XHTML标签是不太常用的，今天园子把使用频率较少但又有些代表性...q与cite标签的应用 (1)前面的文章里园子给大家介绍过：strong和em标签的应用，大家知道这两个标签有一些相似之处...abbr和acronym标签的使用 (2)很多人都喜欢使用缩略词来表述特定的事物或是事件，这样做的好处是方便快递地传达信息，而不用每次...<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="迪拜建筑图赏" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F358.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F70.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/4292254.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="Google 推出主题图片搜索服务 Image Swirl" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F355.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F70.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/4290833.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;">Google 推出主题图片搜索服务 Image Swirl</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="WordPress CommentLuv 插件：同步显示评论者的最新文章" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F386.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F70.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/4292092.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;">WordPress CommentLuv 插件：同步显示评论者的最新文章</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="WordPress 优化插件:Super Switch" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F303.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F70.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/09/14/30891331.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;">WordPress 优化插件:Super Switch</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%2Fuc55.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F70.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/4291468.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>
        </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/category/standards-web" title="WEB标准">WEB标准</a></span>中的表格更不应该用来布局（想了解DIV布局和表格布局的区别的话，请看我以前写的文章：<a href="http://www.yzznl.cn/archives/12.html" title="DIV布局和table布局的区别">DIV布局和table布局的区别</a>）。相反，对于多维数据，你应该使用table。为了使数据表格有更强的访问性，了解和使用各种构造表格的组件就很重要了。例如表格标题（&lt; caption &gt;）、摘要（summary 属性）和表格头部单元格（&lt;th&gt;）等。今天<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/about" title="园子" rel="nofollow">园子</a></span>给大家分享的是在表格里经常用到的一些标签的用法。<br />
<span id="more-35232"></span></p>
<h4>caption标签的使用</h4>
<p>&lt;caption&gt;标签可以为表格提供一个简短的说明，也可以当成标题看待。使用的时候，&lt;caption&gt;标签一定要紧接着开始的&lt;table&gt;标签写，默认情况下，大部分可视化浏览器显示表格标题在表格的上方中央，<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/css" title="css">css</a></span>里的caption-side属性用来控制表格标题显示的地方，大部分浏览器只能把表格标题显示在表格的上方或者下方，只有少部分浏览器支持左边或者右边。</p>
<h4>summary标签的使用</h4>
<p>&lt;summary&gt;与&lt;caption&gt;的关系有点像标题与描述一样，不过这个属性的值是不会被可视化浏览器显示。如果我们是用看的方式看表格，基本内容都可以看出来，但是使用屏幕阅读器的人就不是那么容易了，他们必须依赖&lt;caption&gt;和&lt;summary&gt;属性才能相对快速地来了解表格的内容。当然，通过&lt;summary&gt;可以让表格有更多方面的应用，并非仅仅只是为了满足使用屏幕阅读器的人。</p>
<h4>tr、th、td标签的使用</h4>
<p>&lt;tr&gt;用于指定表格中的一行，而&lt;th&gt;是指标题列，大部分浏览器都会把标题列的内容居中并以粗体显示，&lt;td&gt;才是表格中的单元格。&lt;th&gt;跟&lt;td&gt;这两个都是表格最重要的组成部分，它们必须存在于&lt;tr&gt;的子级，内容都是通过这两者来显示的。</p>
<h4>thead、tfoot、tbody标签的使用</h4>
<p>表格也一样有很完整的结构，它有分头部、主体部分、底部。在HTML4中，它们早已经存在了，不过一直没什么人使用它，在<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/xhtml" title="xhtml">xhtml</a></span>的时代，我们更须要学习它。尝试创建一份声明是html4 strict类型的网页，使用这样的表格：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;table&gt;
&lt;tr&gt;
&lt;th&gt;头部&lt;/th&gt;&lt;th&gt;头部&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;内容&lt;/td&gt;&lt;td&gt;内容&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</pre></td></tr></table></div>

<p>不管是HTML还是XHTML，这几个标签都是提倡使用，非一定要用，但是使用有什么好处呢？园子个人认为有重要的几点是：</p>
<ul>
<li>减少浏览器为渲染表格时额外的检查及错误的添加，可以加速表格的显示；</li>
<li>保持打印时表格的结构；</li>
<li>可以为CSS提供更多的控制条件等。</li>
</ul>
<p>有个特别要注意的地方是：它们顺序是&lt;thead&gt;、&lt;tfoot&gt;、&lt;tbody&gt;，先是表格头部跟底部，然后才是表格的主体内容。</p>
<h4>colgroup、col标签的使用</h4>
<p>有了横向的划分（thead、tfoot、tbody），自然会有纵向的划分。col用于指定基于列的表格默认属性,嵌套的col 属性将覆盖 colgroup属性，而colgroup指定表格中一列或一组列的默认属性。</p>
<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/225.html" title="详解rel=”nofollow”的用法与意义">详解rel=”nofollow”的用法与意义</a> (9)<br /><small>近年来在网站的链接中我们经常会看到类似rel="nofollow"或rel="externa...</small></li><li><a href="http://www.yzznl.cn/archives/72.html" title="网页中表单的使用技巧">网页中表单的使用技巧</a> (0)<br /><small>本文园子总结了在网页常用布局中表单的一些使用技巧，可以帮助你更灵活的控制表单，使页面更加人性...</small></li><li><a href="http://www.yzznl.cn/archives/71.html" title="语义化表单里的标签">语义化表单里的标签</a> (0)<br /><small>表单是用户提交信息的重要渠道，是(X)HTML的一个重要部分。表单主要用于采集和提交用户输入...</small></li><li><a href="http://www.yzznl.cn/archives/69.html" title="定义列表dl,dt,dd的用法">定义列表dl,dt,dd的用法</a> (2)<br /><small>上篇文章给大家分享了无序列表和有序列表的用法，其实一般我们在做列表的时候通常只会用到ul和l...</small></li><li><a href="http://www.yzznl.cn/archives/68.html" title="无序列表和有序列表的用法">无序列表和有序列表的用法</a> (0)<br /><small>首先先来看个截图：



这种以列表形式来显示的内容在网页中称为列表，相信大家都经常...</small></li><li><a href="http://www.yzznl.cn/archives/67.html" title="h1~h6的使用原则">h1~h6的使用原则</a> (2)<br /><small>在遵循<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="网页标准">网页标准</a></span>制作网页的时候，为了使得设计更具有语义化，我们经常会在页面中用到h1~h6的标...</small></li><li><a href="http://www.yzznl.cn/archives/66.html" title="以图换字方法和思路">以图换字方法和思路</a> (2)<br /><small>不知道您在做网站时有没有遇到过这样的问题：想保留链接的背景，但又要链接里的文字消失！可是弄了...</small></li><li><a href="http://www.yzznl.cn/archives/65.html" title="一些少用的XHTML标签">一些少用的XHTML标签</a> (0)<br /><small>在我们的实际应用中，还有一些XHTML标签是不太常用的，今天园子把使用频率较少但又有些代表性...</small></li><li><a href="http://www.yzznl.cn/archives/64.html" title="q与cite标签的应用">q与cite标签的应用</a> (1)<br /><small>前面的文章里园子给大家介绍过：strong和em标签的应用，大家知道这两个标签有一些相似之处...</small></li><li><a href="http://www.yzznl.cn/archives/61.html" title="abbr和acronym标签的使用">abbr和acronym标签的使用</a> (2)<br /><small>很多人都喜欢使用缩略词来表述特定的事物或是事件，这样做的好处是方便快递地传达信息，而不用每次...</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="Google Fast Flip：颠覆传统的在线阅读模式" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F325.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F70.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/4292477.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;">Google Fast Flip：颠覆传统的在线阅读模式</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="WordPress 推出 WordAds 广告系统" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fwordads.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F70.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/11/30/11714370.png" 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;">WordPress 推出 WordAds 广告系统</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%2F70.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="Typetester – 在线对比哪种字体更适合您的网站" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F194.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F70.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/4293046.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;">Typetester – 在线对比哪种字体更适合您的网站</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="Google Related Links 试用手记" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F346.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F70.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/4292306.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;">Google Related Links 试用手记</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/70.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>定义列表dl,dt,dd的用法</title>
		<link>http://www.yzznl.cn/archives/69.html</link>
		<comments>http://www.yzznl.cn/archives/69.html#comments</comments>
		<pubDate>Wed, 25 Feb 2009 03:50:54 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[Xhtml]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/archives/69.html</guid>
		<description><![CDATA[上篇文章给大家分享了无序列表和有序列表的用法，其实一般我们在做列表的时候通常只会用到ul和li标签,至于dl,dt,dd一般都很少用到，这三个标签就是属于定义列表类的标签，下面园子给大家说一下大概的用法。先来分解一下这个列表的代码： 1 2 3 4 &#60;dl&#62;&#60;!–Definition List (定义列表)–&#62; &#60;dt&#62;&#60;/dt&#62;&#60;!–Definition Term （定义项）–&#62; &#60;dd&#62;&#60;/dd&#62;&#60;!–Definition Description （定义描述）–&#62; &#60;/dl&#62; 看上面这段代码我们发现这里并没有出现&#60;li&#62;标签，而是由DL、DT、DD三个标签组成，根据外型以及之前的列表我们可以知道，DL是这个列表的一个容器，就像个箱子，不同的是这次箱子里不只有统一标准的单个小盒子了。而是出现两个不同的内容我们怎么理解这个DT与DD呢？从语义上来讲，DT是名称，是标题，而DD是解释，是内容。DT与DD都是盒子，DD只对应解释他上面的一个DT，不能越级或是向下解释。当DT不存在的时候那么DD也就没有存在的意义，而DT是否一定需要DD跟随其后，这点上我还没有找到确切的文献可以说明这一点，但是以我对于定义列表的理解，我认为如果数据中只有DT没有DD那么这就一不能成为定义列表，直接用UL无序列表就可以了。但是当数据中只有某一个或是少数几个没有DD，而大部分都有DD，那么园子认为这种形式是可以存在的。 再看个例子： 1 2 3 4 5 6 &#60;dl&#62; &#60;dt&#62;有序列表&#60;/dt&#62; &#60;dt&#62;有序列表&#60;/dt&#62; &#60;dt&#62;有序列表&#60;/dt&#62; &#60;dt&#62;有序列表&#60;/dt&#62; &#60;/dl&#62; 以上这种很明显就不合适了，这样的形式就是无序列表，何必要用定义列表呢，从语义上也说不通。 一个DT可以带多个DD吗？例： 1 2 3 4 5 6 7 8 &#60;dl&#62; &#60;dt&#62;国内电视台&#60;/dt&#62; &#60;dd&#62;中央一套&#60;/dd&#62; &#60;dd&#62;中央二套&#60;/dd&#62; &#60;dd&#62;中央三套&#60;/dd&#62; &#60;dt&#62;国外电视台&#60;/dt&#62; &#60;dd&#62;美国在线&#60;/dd&#62; &#60;/dl&#62; 上面这种形式则我个人认为是可行的。关于一个DT是否可以带多个DD的问题，这点上我同样没有找到文献说明不可以，并且在一些知名的网站中这种一个DT带多个DD的依然很多。我对此的看法是，物殊情况下一个DT带多个DD是可以的，但是一般情况上我认为这种做法还是有所欠缺。从解释上来看，多个DD是否表明着多个解释？或是解释内容要分段也不需要让DD来当这只抓耗子的狗。一个DD中完全可以内嵌很多个段落标签。再则从样式应用上来讲，多个DD整体松散，其设计的扩展性不足。比如，当我们要做一个点击DT隐藏对应的DD的效果时，这种多DD的做法就不那么好实现了。所以在不是特殊用途情况下尽可能不要使用一个DT带多个DD的做法，还是把内容放在DD里，分段的就让段落标签去做，分列表的就让有序或是无序列表去表现。您的意见呢？ 最后给一个比较好的例子供大家参考： 1 2 3 4 5 6 [...]<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="WP-PostRatings – 基于 WordPress 的文章评分插件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F171.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F69.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/4293146.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;">WP-PostRatings – 基于 WordPress 的文章评分插件</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%2F71.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F69.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/4290666.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="QQ秀，你关闭了吗？" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F354.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F69.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/4290869.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;">QQ秀，你关闭了吗？</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%2F141.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F69.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/4290252.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="谷歌首次在国内大规模投放户外广告" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F268.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F69.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/4292733.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>
        </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>上篇文章给大家分享了<a href="http://www.yzznl.cn/archives/68.html" title="无序列表和有序列表的用法">无序列表和有序列表的用法</a>，其实一般我们在做列表的时候通常只会用到ul和li标签,至于dl,dt,dd一般都很少用到，这三个标签就是属于定义列表类的标签，下面<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/about" title="园子" rel="nofollow">园子</a></span>给大家说一下大概的用法。先来分解一下这个列表的代码：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;dl&gt;&lt;!–Definition List (定义列表)–&gt;
 &lt;dt&gt;&lt;/dt&gt;&lt;!–Definition Term （定义项）–&gt;
 &lt;dd&gt;&lt;/dd&gt;&lt;!–Definition Description （定义描述）–&gt;
&lt;/dl&gt;</pre></td></tr></table></div>

<p><span id="more-35073"></span></p>
<p>看上面这段代码我们发现这里并没有出现&lt;li&gt;标签，而是由DL、DT、DD三个标签组成，根据外型以及之前的列表我们可以知道，DL是这个列表的一个容器，就像个箱子，不同的是这次箱子里不只有统一标准的单个小盒子了。而是出现两个不同的内容我们怎么理解这个DT与DD呢？从语义上来讲，DT是名称，是标题，而DD是解释，是内容。DT与DD都是盒子，DD只对应解释他上面的一个DT，不能越级或是向下解释。当DT不存在的时候那么DD也就没有存在的意义，而DT是否一定需要DD跟随其后，这点上我还没有找到确切的文献可以说明这一点，但是以我对于定义列表的理解，我认为如果数据中只有DT没有DD那么这就一不能成为定义列表，直接用UL无序列表就可以了。但是当数据中只有某一个或是少数几个没有DD，而大部分都有DD，那么园子认为这种形式是可以存在的。</p>
<p>再看个例子：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;dl&gt;
 &lt;dt&gt;有序列表&lt;/dt&gt;
 &lt;dt&gt;有序列表&lt;/dt&gt;
 &lt;dt&gt;有序列表&lt;/dt&gt;
 &lt;dt&gt;有序列表&lt;/dt&gt;
&lt;/dl&gt;</pre></td></tr></table></div>

<p>以上这种很明显就不合适了，这样的形式就是无序列表，何必要用定义列表呢，从语义上也说不通。</p>
<p>一个DT可以带多个DD吗？例：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;dl&gt;
 &lt;dt&gt;国内电视台&lt;/dt&gt;
 &lt;dd&gt;中央一套&lt;/dd&gt;
 &lt;dd&gt;中央二套&lt;/dd&gt;
 &lt;dd&gt;中央三套&lt;/dd&gt;
 &lt;dt&gt;国外电视台&lt;/dt&gt;
 &lt;dd&gt;美国在线&lt;/dd&gt;
&lt;/dl&gt;</pre></td></tr></table></div>

<p>上面这种形式则我个人认为是可行的。关于一个DT是否可以带多个DD的问题，这点上我同样没有找到文献说明不可以，并且在一些知名的网站中这种一个DT带多个DD的依然很多。我对此的看法是，物殊情况下一个DT带多个DD是可以的，但是一般情况上我认为这种做法还是有所欠缺。从解释上来看，多个DD是否表明着多个解释？或是解释内容要分段也不需要让DD来当这只抓耗子的狗。一个DD中完全可以内嵌很多个段落标签。再则从样式应用上来讲，多个DD整体松散，其设计的扩展性不足。比如，当我们要做一个点击DT隐藏对应的DD的效果时，这种多DD的做法就不那么好实现了。所以在不是特殊用途情况下尽可能不要使用一个DT带多个DD的做法，还是把内容放在DD里，分段的就让段落标签去做，分列表的就让有序或是无序列表去表现。您的意见呢？</p>
<p>最后给一个比较好的例子供大家参考：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;dl&gt;
&lt;dt &gt;《千与千寻》&lt;/dt&gt;
&lt;dd&gt;剧情说的是10岁的少女千寻与父母一起从都市搬家到了乡下。没想到在搬家的途中，一家人
发生了意外。他们进入了汤屋老板魔女控制的奇特世界——在那里不劳动的人将会被变成动物。&lt;/dd&gt;
&lt;dt&gt;《龙猫》&lt;/dt&gt;
&lt;dd&gt;和爸爸一起搬到乡下的两姐妹，在家旁的一棵大树下发现了只有好孩子才能看见的TOTORO。
其间发生了很多不可思议而有趣的故事。&lt;/dd&gt;
&lt;/dl&gt;</pre></td></tr></table></div>

<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/225.html" title="详解rel=”nofollow”的用法与意义">详解rel=”nofollow”的用法与意义</a> (9)<br /><small>近年来在网站的链接中我们经常会看到类似rel="nofollow"或rel="externa...</small></li><li><a href="http://www.yzznl.cn/archives/72.html" title="网页中表单的使用技巧">网页中表单的使用技巧</a> (0)<br /><small>本文园子总结了在网页常用布局中表单的一些使用技巧，可以帮助你更灵活的控制表单，使页面更加人性...</small></li><li><a href="http://www.yzznl.cn/archives/71.html" title="语义化表单里的标签">语义化表单里的标签</a> (0)<br /><small>表单是用户提交信息的重要渠道，是(X)HTML的一个重要部分。表单主要用于采集和提交用户输入...</small></li><li><a href="http://www.yzznl.cn/archives/70.html" title="丰富表格里的标签">丰富表格里的标签</a> (1)<br /><small>表格，一个在网页设计中比较经典的工具。曾经，表格是网页设计人最重要的布局排版手段，但是它的存...</small></li><li><a href="http://www.yzznl.cn/archives/68.html" title="无序列表和有序列表的用法">无序列表和有序列表的用法</a> (0)<br /><small>首先先来看个截图：



这种以列表形式来显示的内容在网页中称为列表，相信大家都经常...</small></li><li><a href="http://www.yzznl.cn/archives/67.html" title="h1~h6的使用原则">h1~h6的使用原则</a> (2)<br /><small>在遵循<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="网页标准">网页标准</a></span>制作网页的时候，为了使得设计更具有语义化，我们经常会在页面中用到h1~h6的标...</small></li><li><a href="http://www.yzznl.cn/archives/66.html" title="以图换字方法和思路">以图换字方法和思路</a> (2)<br /><small>不知道您在做网站时有没有遇到过这样的问题：想保留链接的背景，但又要链接里的文字消失！可是弄了...</small></li><li><a href="http://www.yzznl.cn/archives/65.html" title="一些少用的XHTML标签">一些少用的XHTML标签</a> (0)<br /><small>在我们的实际应用中，还有一些<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/xhtml" title="xhtml">xhtml</a></span>标签是不太常用的，今天园子把使用频率较少但又有些代表性...</small></li><li><a href="http://www.yzznl.cn/archives/64.html" title="q与cite标签的应用">q与cite标签的应用</a> (1)<br /><small>前面的文章里园子给大家介绍过：strong和em标签的应用，大家知道这两个标签有一些相似之处...</small></li><li><a href="http://www.yzznl.cn/archives/61.html" title="abbr和acronym标签的使用">abbr和acronym标签的使用</a> (2)<br /><small>很多人都喜欢使用缩略词来表述特定的事物或是事件，这样做的好处是方便快递地传达信息，而不用每次...</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="iTheme 主题宽度改为960px的方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F312.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F69.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/4292535.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;">iTheme 主题宽度改为960px的方法</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="Google 实用技巧之语言翻译" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F178.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F69.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/4293118.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;">Google 实用技巧之语言翻译</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%2F69.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="祝贺园子博客文章总数达到500篇" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fyzznl-500-articles.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F69.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/4291713.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;">祝贺园子博客文章总数达到500篇</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="WordPress 3.0 发布" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fwordpress-3-0-released.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F69.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/4291919.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;">WordPress 3.0 发布</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/69.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>无序列表和有序列表的用法</title>
		<link>http://www.yzznl.cn/archives/68.html</link>
		<comments>http://www.yzznl.cn/archives/68.html#comments</comments>
		<pubDate>Wed, 25 Feb 2009 01:53:36 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[Xhtml]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/archives/68.html</guid>
		<description><![CDATA[首先先来看个截图： 这种以列表形式来显示的内容在网页中称为列表，相信大家都经常见到，在Word里也有，很多文档编辑里也都有。在HTML中的列表则有三种类型：无序列表、有序列表、定义列表。 那么我们首先就要来理解列表。我们日常生活工作都是琐碎而没有条理的，而要想得到一个高效的友好的信息互通那么就要梳理信息，做好归类。这样才能有效传达信息。用列表把同类的内容进行简单的归纳，我认为这是列表的一个基本作用。常见的用途有：图书目录、饭店菜单、人员名单、待办事宜等等。而这些信息大多不是大篇的信息内容，而是简要的标题。当然列表的用途不是说只能是归纳标题信息，列表并没有去限制内容的多少。只是我们常用列表去归纳的多是些标题信息罢了。 无序列表 那么我们又如何去理解无序列表呢？无序的对应就是有序，从字面上去理解就很容易，有序就是说他本身就标明了前后顺序的，这是严格的，并且这些信息本身就有着顺序特性。比如我们写操作步骤那就就需要明确第一步第二步，这样的信息必然是有序的，而无序呢？也就是说其本身就是无序的没有任何顺序可言。这里要举个实例让大家思考一下：政府部门的领导名单前后顺序是他们最头疼的事，虽然他们有时会写着排名不分先后，但是实际上依然是有排名的，那么这里我想提出问题：这样的名单应用有序列表还是用无序列表呢？当然这个没有标准答案，各人都有各人的思考方式，那么你是怎么想的？不妨在评论上留下你的想法。这里我就不说我是怎么想的，希望大家能多动动脑筋，多思考。 无序列表的标签形式是： 1 2 3 4 5 6 &#60;ul&#62; &#60;li&#62;这就是列表的内容了&#60;/li&#62; &#60;li&#62;这就是列表的内容了&#60;/li&#62; &#60;li&#62;这就是列表的内容了&#60;/li&#62; &#60;li&#62;这就是列表的内容了&#60;/li&#62; &#60;/ul&#62; 这里我们要注意到，无序列表有两个部分，一个是最外面的一个标签&#60;ul&#62;&#60;/ul&#62;，一个是里面的内容&#60;li&#62;&#60;/li&#62;。我们可以这样去理解，&#60;li&#62;&#60;/li&#62;是一个个标准化的小盒子，他们主要存放着列表信息，而&#60;ul&#62;&#60;/ul&#62;则是个大箱子，他的作用就是存放小盒子。这些一个个的小盒子只有放在大箱子里他们才不会弄丢了。整齐而有利于运输（移植）、存放（定位）。那么列表与段落一样可以有很多属性在其中，比如，我们可以为&#60;ul&#62;&#60;/ul&#62;设置一个id或是class或是title等属性，其特点功用与段落中的一样。而&#60;li&#62;&#60;/li&#62;也可以有这些属性，但是一般情况下来说列表即然是同类的一般也不作特殊化处理。 有序列表 信息有时候是无序归纳的，有的却有着明确的顺序，在上一篇也提到了。那么简单的来想一下身边有哪些事物是有先后顺序的：操作步骤、排行榜、书目录……以前我们面对这些有着顺序或是有数字注明排序的内容时大多是在数据前自行加上一个数值，或是由程序加上这个数值。而如果使用有序列表则不需要这么麻烦，根本不用自行去填写序数，当单层列表的时候这种特性似乎并不明显，而当使用多层的时候其特性就很明显了。那么还是先来了解一下有序列表的代码形式： 1 2 3 4 5 6 7 &#60;ol&#62; &#60;li&#62;这就是列表的内容了，这是第一句&#60;/li&#62; &#60;li&#62;这就是列表的内容了，这是第二句&#60;/li&#62; &#60;li&#62;这就是列表的内容了，这是第三句&#60;/li&#62; &#60;li&#62;这就是列表的内容了，这是第四句&#60;/li&#62; &#60;li&#62;这就是列表的内容了，这是第五句&#60;/li&#62; &#60;/ol&#62; 大家看到了其本形式与无序列表的一样，只是在外围标签上名称不同。无序是UL，有序就变成OL了。所不同的是有序列表将会有比无序更多的标签属性。因为是有序的就会涉及顺序的方方面面。 改变有序列表的开始值 通常情况下浏览器会从阿拉伯数字“1”开始自动有序编号。而事有特殊，当有序列表需要变成两个部分，那么下一部人从头开始编号自然就是不对的了。那么下一部分的编号自然是要根据上一段最后一个编号加1为开始号。这就是说我们需要改变列表的开始值。改变开始值的属性是：”start”，正式的写法是： 1 2 3 4 5 6 7 &#60;ol start=”6″&#62; &#60;li&#62;这就是列表的内容了，这是第一句&#60;/li&#62; &#60;li&#62;这就是列表的内容了，这是第二句&#60;/li&#62; &#60;li&#62;这就是列表的内容了，这是第三句&#60;/li&#62; &#60;li&#62;这就是列表的内容了，这是第四句&#60;/li&#62; &#60;li&#62;这就是列表的内容了，这是第五句&#60;/li&#62; &#60;/ol&#62; 大家可以自己试着测试一下，上面这段代码是说列表的开始值是从6开始的，那么现在可以试着在一段有序列表中加入这一属性看看是否发生了变化？ 改变编号类型 [...]<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="Google网站管理员提示：重复的标题标记的解决方案" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fduplicate-title-tags.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F68.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/06/30/15095859.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;">Google网站管理员提示：重复的标题标记的解决方案</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%2Fdeng-yu.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F68.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/11/30/11708340.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="文章被转载后的困惑" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Farticle-was-reprinted.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F68.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/4290901.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="从百度贴吧改版失败看用户习惯的重要性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F124.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F68.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/4293331.png" 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="E63手机 与 WEP 200蓝牙耳机的连接方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fe63-e71-wep200.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F68.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/4291199.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;">E63手机 与 WEP 200蓝牙耳机的连接方法</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>首先先来看个截图：</p>
<p><img src="http://www.yzznl.cn/wp-content/uploads/2009/02/sina.gif" alt="新浪网站列表截图" /></p>
<p>这种以列表形式来显示的内容在网页中称为列表，相信大家都经常见到，在Word里也有，很多文档编辑里也都有。在HTML中的列表则有三种类型：<strong>无序列表</strong>、<strong>有序列表</strong>、<strong>定义列表</strong>。<br />
<span id="more-35067"></span></p>
<p>那么我们首先就要来理解列表。我们日常生活工作都是琐碎而没有条理的，而要想得到一个高效的友好的信息互通那么就要梳理信息，做好归类。这样才能有效传达信息。用列表把同类的内容进行简单的归纳，我认为这是列表的一个基本作用。常见的用途有：图书目录、饭店菜单、人员名单、待办事宜等等。而这些信息大多不是大篇的信息内容，而是简要的标题。当然列表的用途不是说只能是归纳标题信息，列表并没有去限制内容的多少。只是我们常用列表去归纳的多是些标题信息罢了。</p>
<p><strong>无序列表</strong><br />
那么我们又如何去理解无序列表呢？无序的对应就是有序，从字面上去理解就很容易，有序就是说他本身就标明了前后顺序的，这是严格的，并且这些信息本身就有着顺序特性。比如我们写操作步骤那就就需要明确第一步第二步，这样的信息必然是有序的，而无序呢？也就是说其本身就是无序的没有任何顺序可言。这里要举个实例让大家思考一下：政府部门的领导名单前后顺序是他们最头疼的事，虽然他们有时会写着排名不分先后，但是实际上依然是有排名的，那么这里我想提出问题：这样的名单应用有序列表还是用无序列表呢？当然这个没有标准答案，各人都有各人的思考方式，那么你是怎么想的？不妨在评论上留下你的想法。这里我就不说我是怎么想的，希望大家能多动动脑筋，多思考。</p>
<p>无序列表的标签形式是：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;ul&gt;
 &lt;li&gt;这就是列表的内容了&lt;/li&gt;
 &lt;li&gt;这就是列表的内容了&lt;/li&gt;
 &lt;li&gt;这就是列表的内容了&lt;/li&gt;
 &lt;li&gt;这就是列表的内容了&lt;/li&gt;
&lt;/ul&gt;</pre></td></tr></table></div>

<p>这里我们要注意到，无序列表有两个部分，一个是最外面的一个标签&lt;ul&gt;&lt;/ul&gt;，一个是里面的内容&lt;li&gt;&lt;/li&gt;。我们可以这样去理解，&lt;li&gt;&lt;/li&gt;是一个个标准化的小盒子，他们主要存放着列表信息，而&lt;ul&gt;&lt;/ul&gt;则是个大箱子，他的作用就是存放小盒子。这些一个个的小盒子只有放在大箱子里他们才不会弄丢了。整齐而有利于运输（移植）、存放（定位）。那么列表与段落一样可以有很多属性在其中，比如，我们可以为&lt;ul&gt;&lt;/ul&gt;设置一个id或是class或是title等属性，其特点功用与段落中的一样。而&lt;li&gt;&lt;/li&gt;也可以有这些属性，但是一般情况下来说列表即然是同类的一般也不作特殊化处理。</p>
<p><strong>有序列表</strong><br />
信息有时候是无序归纳的，有的却有着明确的顺序，在上一篇也提到了。那么简单的来想一下身边有哪些事物是有先后顺序的：操作步骤、排行榜、书目录……以前我们面对这些有着顺序或是有数字注明排序的内容时大多是在数据前自行加上一个数值，或是由程序加上这个数值。而如果使用有序列表则不需要这么麻烦，根本不用自行去填写序数，当单层列表的时候这种特性似乎并不明显，而当使用多层的时候其特性就很明显了。那么还是先来了解一下有序列表的代码形式：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;ol&gt;
 &lt;li&gt;这就是列表的内容了，这是第一句&lt;/li&gt;
 &lt;li&gt;这就是列表的内容了，这是第二句&lt;/li&gt;
 &lt;li&gt;这就是列表的内容了，这是第三句&lt;/li&gt;
 &lt;li&gt;这就是列表的内容了，这是第四句&lt;/li&gt;
 &lt;li&gt;这就是列表的内容了，这是第五句&lt;/li&gt;
&lt;/ol&gt;</pre></td></tr></table></div>

<p>大家看到了其本形式与无序列表的一样，只是在外围标签上名称不同。无序是UL，有序就变成OL了。所不同的是有序列表将会有比无序更多的标签属性。因为是有序的就会涉及顺序的方方面面。</p>
<p>改变有序列表的开始值<br />
通常情况下浏览器会从阿拉伯数字“1”开始自动有序编号。而事有特殊，当有序列表需要变成两个部分，那么下一部人从头开始编号自然就是不对的了。那么下一部分的编号自然是要根据上一段最后一个编号加1为开始号。这就是说我们需要改变列表的开始值。改变开始值的属性是：”start”，正式的写法是：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;ol start=”6″&gt;
 &lt;li&gt;这就是列表的内容了，这是第一句&lt;/li&gt;
 &lt;li&gt;这就是列表的内容了，这是第二句&lt;/li&gt;
 &lt;li&gt;这就是列表的内容了，这是第三句&lt;/li&gt;
 &lt;li&gt;这就是列表的内容了，这是第四句&lt;/li&gt;
 &lt;li&gt;这就是列表的内容了，这是第五句&lt;/li&gt;
&lt;/ol&gt;</pre></td></tr></table></div>

<p>大家可以自己试着测试一下，上面这段代码是说列表的开始值是从6开始的，那么现在可以试着在一段有序列表中加入这一属性看看是否发生了变化？</p>
<p>改变编号类型<br />
浏览器中默认一般都是阿拉伯数字为列表编号，那么是否可以有别的类型呢？有，属性为“type”，不过提供的类型不多，只有五种：</p>
<table border="0" width="100%" cellPadding="5" cellSpacing="0">
<tr>
<td><strong> 类型值</strong></td>
<td><strong> 生成样式</strong></td>
<td><strong> 序列举例</strong></td>
</tr>
<tr>
<td> A</td>
<td> 大写字母</td>
<td> A、B、C、D、E</td>
</tr>
<tr>
<td> a</td>
<td> 小写字母</td>
<td> a、b、c、c、e</td>
</tr>
<tr>
<td> I</td>
<td> 大写罗马数字</td>
<td> I、II、III、IV、V</td>
</tr>
<tr>
<td> i</td>
<td> 小写罗马数字</td>
<td> i、ii、iii、iv、v</td>
</tr>
<tr>
<td> 1</td>
<td> 阿拉伯数字</td>
<td> 1、2、3、4、5</td>
</tr>
</table>
<p>在代码中的写法应该是： </p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;ol type=”A”&gt;
 &lt;li&gt;这就是列表的内容了，这是第一句&lt;/li&gt;
 &lt;li&gt;这就是列表的内容了，这是第二句&lt;/li&gt;
 &lt;li&gt;这就是列表的内容了，这是第三句&lt;/li&gt;
 &lt;li&gt;这就是列表的内容了，这是第四句&lt;/li&gt;
 &lt;li&gt;这就是列表的内容了，这是第五句&lt;/li&gt;
&lt;/ol&gt;</pre></td></tr></table></div>

<p>我认为这个类型值大家还是少用为好，因为用<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>一向主张样式方面的事应由样式语言来做。那么除非特殊原因，这个属性还是不用为好。当然无论是CSS1还是CSS2基本上都没考虑中国，在CSS2中已经为提供了日文编号字符，可是还没有中文。我认为在这点上CSS2还是有着缺陷的，至少他没有提供更好的扩展形式。虽然他没提供，但是我们一样可以用我们自己的形式去完成多样化。</p>
<p>到这里大家一定会问，不是还有一种列表类型吗？不错，就是定义列表，园子准备在下篇文章中给大家介绍下<a href="http://www.yzznl.cn/archives/69.html" title="定义列表的使用方法">定义列表的使用方法</a>。</p>
<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/225.html" title="详解rel=”nofollow”的用法与意义">详解rel=”nofollow”的用法与意义</a> (9)<br /><small>近年来在网站的链接中我们经常会看到类似rel="nofollow"或rel="externa...</small></li><li><a href="http://www.yzznl.cn/archives/72.html" title="网页中表单的使用技巧">网页中表单的使用技巧</a> (0)<br /><small>本文园子总结了在网页常用布局中表单的一些使用技巧，可以帮助你更灵活的控制表单，使页面更加人性...</small></li><li><a href="http://www.yzznl.cn/archives/71.html" title="语义化表单里的标签">语义化表单里的标签</a> (0)<br /><small>表单是用户提交信息的重要渠道，是(X)HTML的一个重要部分。表单主要用于采集和提交用户输入...</small></li><li><a href="http://www.yzznl.cn/archives/70.html" title="丰富表格里的标签">丰富表格里的标签</a> (1)<br /><small>表格，一个在网页设计中比较经典的工具。曾经，表格是网页设计人最重要的布局排版手段，但是它的存...</small></li><li><a href="http://www.yzznl.cn/archives/69.html" title="定义列表dl,dt,dd的用法">定义列表dl,dt,dd的用法</a> (2)<br /><small>上篇文章给大家分享了无序列表和有序列表的用法，其实一般我们在做列表的时候通常只会用到ul和l...</small></li><li><a href="http://www.yzznl.cn/archives/67.html" title="h1~h6的使用原则">h1~h6的使用原则</a> (2)<br /><small>在遵循<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="网页标准">网页标准</a></span>制作网页的时候，为了使得设计更具有语义化，我们经常会在页面中用到h1~h6的标...</small></li><li><a href="http://www.yzznl.cn/archives/66.html" title="以图换字方法和思路">以图换字方法和思路</a> (2)<br /><small>不知道您在做网站时有没有遇到过这样的问题：想保留链接的背景，但又要链接里的文字消失！可是弄了...</small></li><li><a href="http://www.yzznl.cn/archives/65.html" title="一些少用的XHTML标签">一些少用的XHTML标签</a> (0)<br /><small>在我们的实际应用中，还有一些<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/xhtml" title="xhtml">xhtml</a></span>标签是不太常用的，今天园子把使用频率较少但又有些代表性...</small></li><li><a href="http://www.yzznl.cn/archives/64.html" title="q与cite标签的应用">q与cite标签的应用</a> (1)<br /><small>前面的文章里园子给大家介绍过：strong和em标签的应用，大家知道这两个标签有一些相似之处...</small></li><li><a href="http://www.yzznl.cn/archives/61.html" title="abbr和acronym标签的使用">abbr和acronym标签的使用</a> (2)<br /><small>很多人都喜欢使用缩略词来表述特定的事物或是事件，这样做的好处是方便快递地传达信息，而不用每次...</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="通过 orkut 关注好友的地理位置" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F182.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F68.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/4290306.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;">通过 orkut 关注好友的地理位置</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%2F107.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F68.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/4290085.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="Google 准备进军团购业务" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fgoogle-offers.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F68.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/4290774.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;">Google 准备进军团购业务</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="wordpress分页插件pagebar介绍" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fwordpress-pagebar.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F68.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/4293861.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;">wordpress分页插件pagebar介绍</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="谷歌创意Logo“吃豆人”" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fgoogle-creative-logo-pac-man.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F68.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/04/4992710.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;">谷歌创意Logo“吃豆人”</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/68.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>h1~h6的使用原则</title>
		<link>http://www.yzznl.cn/archives/67.html</link>
		<comments>http://www.yzznl.cn/archives/67.html#comments</comments>
		<pubDate>Tue, 24 Feb 2009 02:05:28 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[Xhtml]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/archives/67.html</guid>
		<description><![CDATA[在遵循网页标准制作网页的时候，为了使得设计更具有语义化，我们经常会在页面中用到h1~h6的标题属性。我们都知道标题几乎是所有文章都会有的要素，也是我们用以识实与索引文章的重要元素。我们通过标题去感知文章内的核心。那么你知道吗？合理使用标题标签会让你的文章更受关注。 我们都知道xhtml给我们提供了h1~h6，六个标题标签，那么我们如何分配这六个标题标签的使用呢？下面园子给出一些建议： h1，在浏览器中显示最大，那么自然用来表示最大的标题，对于一个网站来说哪个标题才是最大的？是LOGO，我们通常会在网站的最前面先标注这个网站的名称。所以h1就用来放LOGO，当然如果你的网站没有LOGO，只有一个网站名称，那也可以，并且需要注意的是网页中h1只能出现一次。园子并不推荐您直接在h1里面放个图片，我们完全可以通过以图换字来实现，具体方法请看我的上篇文章：以图换字方法和思路 。 当h1找到了专用的功能后，园子在平时的设计中h2~h4一般用在网页中出现的版块标题上。例如一个网页中有个栏目是产品展示，那么这个写法就是&#60;h2&#62;产品展示&#60;/h2&#62;，如果产品展示里面还分有几个类型，那么我们可以这样定义：&#60;h3&#62;食品类&#60;/h3&#62;，&#60;h3&#62;医药类&#60;/h3&#62;等等依次类推。需要注意的是书写顺序要从高到低依次书写。另外就是h2~h4不局限于出现的次数，你可以无限制使用。 h5与h6在浏览器默认显示字体是小于正常文本字体的。那么园子推荐h5与h6只作为免责声明或是版权通告来使用。这样即表明重要性，又不会太过明显影响阅读。 对于标题标签的使用尽可能的注意一下他们之间的等级关系。当然标题的使用还是需要根据实际使用来决定。这里只是给出个建议。标题标签是块线元素，但是他并不能再包含块级元素了，只能包含内联的元素，比如链接、图像，换行之类的。记得有个朋友前两天在文章中提到过关于标题的内容，但是写法就有错了，他把链接写在了H1标签的外面，把H1包起来了，这样的写法是不推荐的。也不符合标准思维容易给以后的学习产生不好导向。 扩展阅读详解rel=”nofollow”的用法与意义 (9)近年来在网站的链接中我们经常会看到类似rel="nofollow"或rel="externa...网页中表单的使用技巧 (0)本文园子总结了在网页常用布局中表单的一些使用技巧，可以帮助你更灵活的控制表单，使页面更加人性...语义化表单里的标签 (0)表单是用户提交信息的重要渠道，是(X)HTML的一个重要部分。表单主要用于采集和提交用户输入...丰富表格里的标签 (1)表格，一个在网页设计中比较经典的工具。曾经，表格是网页设计人最重要的布局排版手段，但是它的存...定义列表dl,dt,dd的用法 (2)上篇文章给大家分享了无序列表和有序列表的用法，其实一般我们在做列表的时候通常只会用到ul和l...无序列表和有序列表的用法 (0)首先先来看个截图： 这种以列表形式来显示的内容在网页中称为列表，相信大家都经常...以图换字方法和思路 (2)不知道您在做网站时有没有遇到过这样的问题：想保留链接的背景，但又要链接里的文字消失！可是弄了...一些少用的XHTML标签 (0)在我们的实际应用中，还有一些XHTML标签是不太常用的，今天园子把使用频率较少但又有些代表性...q与cite标签的应用 (1)前面的文章里园子给大家介绍过：strong和em标签的应用，大家知道这两个标签有一些相似之处...abbr和acronym标签的使用 (2)很多人都喜欢使用缩略词来表述特定的事物或是事件，这样做的好处是方便快递地传达信息，而不用每次...<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="深度美化主题包 6.5 下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F389.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F67.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/4289916.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;">深度美化主题包 6.5 下载</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="IE6中 PNG 背景透明的最佳解决方案" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fie6-png-transparent.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F67.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;">IE6中 PNG 背景透明的最佳解决方案</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="IE6 真的该死了吗" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F292.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F67.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/4290884.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;">IE6 真的该死了吗</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%2F67.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="WordPress 3.0.1 官方简体中文正式版发布" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fwordpress-3-0-1-chinese.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F67.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;">WordPress 3.0.1 官方简体中文正式版发布</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/category/standards-web" title="网页标准">网页标准</a></span>制作网页的时候，为了使得设计更具有语义化，我们经常会在页面中用到h1~h6的标题属性。我们都知道标题几乎是所有文章都会有的要素，也是我们用以识实与索引文章的重要元素。我们通过标题去感知文章内的核心。那么你知道吗？合理使用标题标签会让你的文章更受关注。</p>
<p>我们都知道<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/xhtml" title="xhtml">xhtml</a></span>给我们提供了h1~h6，六个标题标签，那么我们如何分配这六个标题标签的使用呢？下面<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/about" title="园子" rel="nofollow">园子</a></span>给出一些建议：<br />
<span id="more-35003"></span></p>
<ul>
<li>h1，在浏览器中显示最大，那么自然用来表示最大的标题，对于一个网站来说哪个标题才是最大的？是LOGO，我们通常会在网站的最前面先标注这个网站的名称。所以h1就用来放LOGO，当然如果你的网站没有LOGO，只有一个网站名称，那也可以，并且需要注意的是网页中h1只能出现一次。园子并不推荐您直接在h1里面放个图片，我们完全可以通过以图换字来实现，具体方法请看我的上篇文章：<a href="http://www.yzznl.cn/archives/66.html" title="以图换字方法和思路">以图换字方法和思路</a> 。</li>
<li>当h1找到了专用的功能后，园子在平时的设计中h2~h4一般用在网页中出现的版块标题上。例如一个网页中有个栏目是产品展示，那么这个写法就是&lt;h2&gt;产品展示&lt;/h2&gt;，如果产品展示里面还分有几个类型，那么我们可以这样定义：&lt;h3&gt;食品类&lt;/h3&gt;，&lt;h3&gt;医药类&lt;/h3&gt;等等依次类推。需要注意的是书写顺序要从高到低依次书写。另外就是h2~h4不局限于出现的次数，你可以无限制使用。</li>
<li>h5与h6在浏览器默认显示字体是小于正常文本字体的。那么园子推荐h5与h6只作为免责声明或是版权通告来使用。这样即表明重要性，又不会太过明显影响阅读。</li>
</ul>
<p>对于标题标签的使用尽可能的注意一下他们之间的等级关系。当然标题的使用还是需要根据实际使用来决定。这里只是给出个建议。标题标签是块线元素，但是他并不能再包含块级元素了，只能包含内联的元素，比如链接、图像，换行之类的。记得有个朋友前两天在文章中提到过关于标题的内容，但是写法就有错了，他把链接写在了H1标签的外面，把H1包起来了，这样的写法是不推荐的。也不符合标准思维容易给以后的学习产生不好导向。</p>
<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/225.html" title="详解rel=”nofollow”的用法与意义">详解rel=”nofollow”的用法与意义</a> (9)<br /><small>近年来在网站的链接中我们经常会看到类似rel="nofollow"或rel="externa...</small></li><li><a href="http://www.yzznl.cn/archives/72.html" title="网页中表单的使用技巧">网页中表单的使用技巧</a> (0)<br /><small>本文园子总结了在网页常用布局中表单的一些使用技巧，可以帮助你更灵活的控制表单，使页面更加人性...</small></li><li><a href="http://www.yzznl.cn/archives/71.html" title="语义化表单里的标签">语义化表单里的标签</a> (0)<br /><small>表单是用户提交信息的重要渠道，是(X)HTML的一个重要部分。表单主要用于采集和提交用户输入...</small></li><li><a href="http://www.yzznl.cn/archives/70.html" title="丰富表格里的标签">丰富表格里的标签</a> (1)<br /><small>表格，一个在网页设计中比较经典的工具。曾经，表格是网页设计人最重要的布局排版手段，但是它的存...</small></li><li><a href="http://www.yzznl.cn/archives/69.html" title="定义列表dl,dt,dd的用法">定义列表dl,dt,dd的用法</a> (2)<br /><small>上篇文章给大家分享了无序列表和有序列表的用法，其实一般我们在做列表的时候通常只会用到ul和l...</small></li><li><a href="http://www.yzznl.cn/archives/68.html" title="无序列表和有序列表的用法">无序列表和有序列表的用法</a> (0)<br /><small>首先先来看个截图：



这种以列表形式来显示的内容在网页中称为列表，相信大家都经常...</small></li><li><a href="http://www.yzznl.cn/archives/66.html" title="以图换字方法和思路">以图换字方法和思路</a> (2)<br /><small>不知道您在做网站时有没有遇到过这样的问题：想保留链接的背景，但又要链接里的文字消失！可是弄了...</small></li><li><a href="http://www.yzznl.cn/archives/65.html" title="一些少用的XHTML标签">一些少用的XHTML标签</a> (0)<br /><small>在我们的实际应用中，还有一些XHTML标签是不太常用的，今天园子把使用频率较少但又有些代表性...</small></li><li><a href="http://www.yzznl.cn/archives/64.html" title="q与cite标签的应用">q与cite标签的应用</a> (1)<br /><small>前面的文章里园子给大家介绍过：strong和em标签的应用，大家知道这两个标签有一些相似之处...</small></li><li><a href="http://www.yzznl.cn/archives/61.html" title="abbr和acronym标签的使用">abbr和acronym标签的使用</a> (2)<br /><small>很多人都喜欢使用缩略词来表述特定的事物或是事件，这样做的好处是方便快递地传达信息，而不用每次...</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="深度美化主题包 6.5 下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F389.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F67.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/4289916.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;">深度美化主题包 6.5 下载</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="IE6中 PNG 背景透明的最佳解决方案" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fie6-png-transparent.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F67.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;">IE6中 PNG 背景透明的最佳解决方案</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="IE6 真的该死了吗" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F292.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F67.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/4290884.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;">IE6 真的该死了吗</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%2F67.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="WordPress 3.0.1 官方简体中文正式版发布" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fwordpress-3-0-1-chinese.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F67.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;">WordPress 3.0.1 官方简体中文正式版发布</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/67.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>以图换字方法和思路</title>
		<link>http://www.yzznl.cn/archives/66.html</link>
		<comments>http://www.yzznl.cn/archives/66.html#comments</comments>
		<pubDate>Tue, 24 Feb 2009 01:48:09 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[网页标准]]></category>
		<category><![CDATA[Xhtml]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/archives/65-2.html</guid>
		<description><![CDATA[不知道您在做网站时有没有遇到过这样的问题：想保留链接的背景，但又要链接里的文字消失！可是弄了半天一直没办法把这个文字去掉。我想很多学标准的朋友都遇到过这个问题，这里园子把常用的几个方法写出来，把思路也讲一下，希望能帮助刚开始学习的朋友。 “以图换字”就是用图片替换文字表现。我们都知道，文字在浏览器里的表现形式是很差的，会有锯齿，没办法圆润还有没办法做很多效果。一般情况下网页的内容部分是不需要做效果的，但是在WEB标准中对于LOGO、标题，常常需要用到这些。用表格来做的话我们只是在某个地方帖上一张图，这样的方式比较简单，但是不利于搜索。所以我们需要采用标准方式来做，保证网页处于一种良好的状态而有利于搜索。通常以图显示消失：(display:none;) 这不只是让容器内的内容消失而是包括容器本身都消失。所以我们必需在容器内再做一个容器来保证内消失部分之后，容器内的背景可以正常显示。例 ： &#60;div id=”logo”&#62;标题内容&#60;/div&#62;#logo {display:none; background:URL; width:300px; height:100px;} 如果是这样写那么你根本什么也看不到。那正确的方式是什么写呢？看示例： &#60;div id=”logo”&#62;&#60;span&#62;标题内容&#60;/span&#62;&#60;/div&#62;#logo {background:URL; width:300px; height:100px;}#logo span {display:none;} 大家注意上面的代码，背景是在#logo下定义，而#logo span下除了display:none;没有任何样式。因为被定义了display:none;属性的容器会一无所见，如果定义其它样式也是浪费。光是这样还是有问题，这是个没有链接的例子，那有链接的时候怎么办呢？我们再来看个例子： &#60;div id=”logo”&#62;&#60;a href=”URL” mce_href=”URL” title=”标题”&#62;标题内容&#60;/a&#62;&#60;/div&#62;#logo {background:URL; width:300px; height:100px;}#logo a {display:none;} 大家猜一下这个代码能显示出东西吗？事实是背景显示了，可是链接没了。我们上面说过：被赋于了display:none;属性的容器自身也会消失。那我们就清楚了，必需要在这个A标签里加个容器。我们再看示例： &#60;div id=”logo”&#62;&#60;a href=”URL” mce_href=”URL” title=”标题”&#62;&#60;span&#62;标题内容&#60;/span&#62;&#60;/a&#62;&#60;/div&#62;#logo {background:URL; width:300px; height:100px;}#logo a span {display:none;} 这样的是不是就正确了呢？还是不行，为什么呢，我们都知道A不是块级标签，也就是说A的高宽都是内容来决定的，现在内容消失了，也就没有了这个高宽的属性了，那么这个链接也就成了一个没有热区的链接了。可能是点不着的。我们必需要把上面的代码再做修改。 &#60;div id=”logo”&#62;&#60;a href=”URL” mce_href=”URL” title=”标题”&#62;&#60;span&#62;标题内容&#60;/span&#62;&#60;/a&#62;&#60;/div&#62;#logo a {background:URL; width:300px; height:100px; display:block;}#logo a span [...]<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="视频转换必备工具：格式工厂" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F393.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F66.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/4292051.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="网络密码，那些难以言说的痛" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fpassword.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F66.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/12/22/12861675.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="Hello 2012" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fhello-2012.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F66.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/12/31/13297191.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;">Hello 2012</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%2F68.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F66.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/4290680.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="2009年情人节logo欣赏" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F50.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F66.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/4293625.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;">2009年情人节logo欣赏</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>把常用的几个方法写出来，把思路也讲一下，希望能帮助刚开始学习的朋友。</p>
<p>“以图换字”就是用图片替换文字表现。我们都知道，文字在浏览器里的表现形式是很差的，会有锯齿，没办法圆润还有没办法做很多效果。一般情况下网页的内容部分是不需要做效果的，但是在<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="WEB标准">WEB标准</a></span>中对于LOGO、标题，常常需要用到这些。用表格来做的话我们只是在某个地方帖上一张图，这样的方式比较简单，但是不利于搜索。所以我们需要采用标准方式来做，保证网页处于一种良好的状态而有利于搜索。通常以图显示消失：(display:none;) 这不只是让容器内的内容消失而是包括容器本身都消失。所以我们必需在容器内再做一个容器来保证内消失部分之后，容器内的背景可以正常显示。例 ：<br />
<span id="more-35002"></span></p>
<p><font color="#0099cc">&lt;div id=”logo”&gt;标题内容&lt;/div&gt;#logo {display:none; background:URL; width:300px; height:100px;}</font></p>
<p>如果是这样写那么你根本什么也看不到。那正确的方式是什么写呢？看示例：</p>
<p><font color="#0099cc">&lt;div id=”logo”&gt;&lt;span&gt;标题内容&lt;/span&gt;&lt;/div&gt;#logo {background:URL; width:300px; height:100px;}#logo span {display:none;}</font></p>
<p>大家注意上面的代码，背景是在#logo下定义，而#logo span下除了display:none;没有任何样式。因为被定义了display:none;属性的容器会一无所见，如果定义其它样式也是浪费。光是这样还是有问题，这是个没有链接的例子，那有链接的时候怎么办呢？我们再来看个例子：</p>
<p><font color="#0099cc">&lt;div id=”logo”&gt;&lt;a href=”URL” mce_href=”URL” title=”标题”&gt;标题内容&lt;/a&gt;&lt;/div&gt;#logo {background:URL; width:300px; height:100px;}#logo a {display:none;}</font></p>
<p>大家猜一下这个代码能显示出东西吗？事实是背景显示了，可是链接没了。我们上面说过：被赋于了display:none;属性的容器自身也会消失。那我们就清楚了，必需要在这个A标签里加个容器。我们再看示例：</p>
<p><font color="#0099cc">&lt;div id=”logo”&gt;&lt;a href=”URL” mce_href=”URL” title=”标题”&gt;&lt;span&gt;标题内容&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;#logo {background:URL; width:300px; height:100px;}#logo a span {display:none;}</font></p>
<p>这样的是不是就正确了呢？还是不行，为什么呢，我们都知道A不是块级标签，也就是说A的高宽都是内容来决定的，现在内容消失了，也就没有了这个高宽的属性了，那么这个链接也就成了一个没有热区的链接了。可能是点不着的。我们必需要把上面的代码再做修改。</p>
<p><font color="#0099cc">&lt;div id=”logo”&gt;&lt;a href=”URL” mce_href=”URL” title=”标题”&gt;&lt;span&gt;标题内容&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;#logo a {background:URL; width:300px; height:100px; display:block;}#logo a span {display:none;}</font></p>
<p>注意这里的A标签的属性一定要加上display:block;把他强制为块级元素。这样A标签就成了一个宽为300高为100，有一个背景没有文字内容的链接形式。大家看到了上面在A标签里还加了一个span标签，好像有点多余。能不能不用span也可以实现效果呢。可以，不过思路就不一样了，而是下面的这种位置移动法。</p>
<p>位置移动：也就是让内容啊分进行位置移动，移出显示区之外。我们还是看代码来了解这个方法。</p>
<p><font color="#0099cc">&lt;div id=”logo”&gt;&lt;a href=”URL” mce_href=”URL” title=”标题”&gt;标题内容&lt;/a&gt;&lt;/div&gt;#logo, #logo a {width:300px; height:100px; overflow:hidden;}#logo a {background:URL; padding:100px 0 0; display:block;}</font></p>
<p>在<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/css" title="css">css</a></span>中设置了#logo与A有一个溢出隐藏(overflow:hidden;)也就是说有超出300*100大小的就会被隐藏。我们看A被定义了一个padding:100px 0 0; 这个顶部的内距正好把内容压到了显示区以外。那为什么#logo也要用overflow:hidden;呢？因为在IE下会出现一个小BUG，A的内容没办法溢出隐藏所以必需要在父级标签上还要加一个overflow:hidden;</p>
<p>以上内容只是园子比较常用的两种方法，当然还会有一些别的方式方法，这些方法都有各自的有缺点，不过各种方法之间也都有互补的。在应用时可以依据情况选择使用即可。</p>
<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/225.html" title="详解rel=”nofollow”的用法与意义">详解rel=”nofollow”的用法与意义</a> (9)<br /><small>近年来在网站的链接中我们经常会看到类似rel="nofollow"或rel="externa...</small></li><li><a href="http://www.yzznl.cn/archives/72.html" title="网页中表单的使用技巧">网页中表单的使用技巧</a> (0)<br /><small>本文园子总结了在网页常用布局中表单的一些使用技巧，可以帮助你更灵活的控制表单，使页面更加人性...</small></li><li><a href="http://www.yzznl.cn/archives/71.html" title="语义化表单里的标签">语义化表单里的标签</a> (0)<br /><small>表单是用户提交信息的重要渠道，是(X)HTML的一个重要部分。表单主要用于采集和提交用户输入...</small></li><li><a href="http://www.yzznl.cn/archives/70.html" title="丰富表格里的标签">丰富表格里的标签</a> (1)<br /><small>表格，一个在网页设计中比较经典的工具。曾经，表格是网页设计人最重要的布局排版手段，但是它的存...</small></li><li><a href="http://www.yzznl.cn/archives/69.html" title="定义列表dl,dt,dd的用法">定义列表dl,dt,dd的用法</a> (2)<br /><small>上篇文章给大家分享了无序列表和有序列表的用法，其实一般我们在做列表的时候通常只会用到ul和l...</small></li><li><a href="http://www.yzznl.cn/archives/68.html" title="无序列表和有序列表的用法">无序列表和有序列表的用法</a> (0)<br /><small>首先先来看个截图：



这种以列表形式来显示的内容在网页中称为列表，相信大家都经常...</small></li><li><a href="http://www.yzznl.cn/archives/67.html" title="h1~h6的使用原则">h1~h6的使用原则</a> (2)<br /><small>在遵循<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="网页标准">网页标准</a></span>制作网页的时候，为了使得设计更具有语义化，我们经常会在页面中用到h1~h6的标...</small></li><li><a href="http://www.yzznl.cn/archives/65.html" title="一些少用的XHTML标签">一些少用的XHTML标签</a> (0)<br /><small>在我们的实际应用中，还有一些<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/xhtml" title="xhtml">xhtml</a></span>标签是不太常用的，今天园子把使用频率较少但又有些代表性...</small></li><li><a href="http://www.yzznl.cn/archives/64.html" title="q与cite标签的应用">q与cite标签的应用</a> (1)<br /><small>前面的文章里园子给大家介绍过：strong和em标签的应用，大家知道这两个标签有一些相似之处...</small></li><li><a href="http://www.yzznl.cn/archives/61.html" title="abbr和acronym标签的使用">abbr和acronym标签的使用</a> (2)<br /><small>很多人都喜欢使用缩略词来表述特定的事物或是事件，这样做的好处是方便快递地传达信息，而不用每次...</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="WordPress 技巧：更新时只更新核心文件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fwp-update.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F66.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/12/08/12058402.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;">WordPress 技巧：更新时只更新核心文件</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="Google 退出了，中国人用什么搜索？" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F374.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F66.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/4292162.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;">Google 退出了，中国人用什么搜索？</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="2011 寒冬郑州第一场雪" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F2011-xue.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F66.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/11/29/11672874.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;">2011 寒冬郑州第一场雪</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="网页设计中如何避免 IE 浏览器图片下方的空隙" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F384.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F66.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/4290983.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;">网页设计中如何避免 IE 浏览器图片下方的空隙</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="最简单的批量添加水印工具：PicWatermark" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F332-2.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F66.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/4292427.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;">最简单的批量添加水印工具：PicWatermark</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/66.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>一些少用的XHTML标签</title>
		<link>http://www.yzznl.cn/archives/65.html</link>
		<comments>http://www.yzznl.cn/archives/65.html#comments</comments>
		<pubDate>Mon, 23 Feb 2009 06:52:06 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[Xhtml]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/archives/65.html</guid>
		<description><![CDATA[在我们的实际应用中，还有一些xhtml标签是不太常用的，今天园子把使用频率较少但又有些代表性的几个标签给大家分享一下。 kdb标签 表示由用户从键盘输入的文字，例如： &#60;p&#62;在浏览器的地址栏打上&#60;kbd&#62;www.yzznl.cn&#60;/kbd&#62;。&#60;/p&#62; 但是，也有人把他理解成用户从键盘输入的按键，例如： &#60;p&#62;按&#60;kbd&#62;Tab&#60;/kbd&#62;测试一下&#60;/p&#62; 并能过用css把&#60;kdb /&#62;定义得有点像键盘按键，如下图： 对于这个这元素，W3C的文档并没有怎样说明，也没有例子参考，谁对谁错也很难说清。园子个人更倾向把它用于定义键盘按键，或者可以这样理解，如果&#60;kbd&#62;里面的是键盘上有的（比如Tab、Esc、Backspace等）就是直接按键盘上的键，如果不是键盘上的键名的（比如网址、文字等），就由单个字母输入完成。但是这样可能会有些冲突，例如Home，是让输入Home还是按Home键呢？也许这时应该再加上title提示会更好。 code &#38; var标签 在(X)HTML中，有专门对代码进行标识的标签，那就是&#60;code&#62;&#60;/code&#62;，例如：你可以用&#60;code&#62;code&#60;/code&#62;标签来表示计算机（程序）代码。而var是定义一个变量名，例如计算机程序的变量、数学函数的变量等。例如： &#60;code&#62;&#60;var&#62;wordcount&#60;/var&#62; = 6878;&#60;/code&#62; pre标签 上面说了code标签的用法，或许你会发现紧紧&#60;code&#62;是不够用的，因为代码都是一行一行的，如果你只用&#60;code&#62;的话，所有用它来标识的代码，就会堆到一行去，这又是为什么呢？因为，&#60;code&#62;是inline-level（行内元素）的，行内元素是不换行的。这就有必要说下pre标签。 pre标签标签在Dreamweaver中被称为“格式化”，在以前使用Dreamweaver 的时候我一直不清楚这个东西是作什么用的。一直到现在才清楚pre通常用以显示源代码，并且不支持能使段落分开的标签比如&#60;p&#62;，显示内容如需换行只要在源文件中换行即可无需要代码实现。同时pre会保留注其中的所有空格并显示出来。一般来讲pre目前是多用于显示源代码，这与code的用途是相似的，所不同的是pre是块级的，而code是内联的。简单说，pre可以包括多行内容，而code只包含短小的一句或几个字符。 samp标签 samp标签用于定义一个“输出”的内容，例如： &#60;p&#62;你只要点删除，网页就会提示&#60;samp&#62;该会话已移至“已删除邮件”&#60;/samp&#62;。&#60;/p&#62; sup与sub标签 你还记得上标和下标吗？在所有的标签中有两上标签是样式标签，但是却没有被禁用，因为这两个标签所表述的内容很特别，上下标，&#60;sup&#62;上标&#60;/sup&#62;,&#60;sub&#62;下标&#60;/sub&#62;。这两个标签用得到机率比较小，但是上标应该还是会常用到的，比如温度中的摄氏度的上的小圆圈，当然现有有专业的字符对应“℃”，还有我们常看到书中的脚注上标等等。 hr与br标签 hr，分平分隔线； br，常用的换行符。 这两个标签只要注意标签的写法就可以了，很多粗心的人都不小心的把写错了，&#60;hr /&#62;和&#60;br /&#62;，要提醒你的是这两个都是单标签，记得后面要闭合。 扩展阅读详解rel=”nofollow”的用法与意义 (9)近年来在网站的链接中我们经常会看到类似rel="nofollow"或rel="externa...网页中表单的使用技巧 (0)本文园子总结了在网页常用布局中表单的一些使用技巧，可以帮助你更灵活的控制表单，使页面更加人性...语义化表单里的标签 (0)表单是用户提交信息的重要渠道，是(X)HTML的一个重要部分。表单主要用于采集和提交用户输入...丰富表格里的标签 (1)表格，一个在网页设计中比较经典的工具。曾经，表格是网页设计人最重要的布局排版手段，但是它的存...定义列表dl,dt,dd的用法 (2)上篇文章给大家分享了无序列表和有序列表的用法，其实一般我们在做列表的时候通常只会用到ul和l...无序列表和有序列表的用法 (0)首先先来看个截图： 这种以列表形式来显示的内容在网页中称为列表，相信大家都经常...h1~h6的使用原则 (2)在遵循网页标准制作网页的时候，为了使得设计更具有语义化，我们经常会在页面中用到h1~h6的标...以图换字方法和思路 (2)不知道您在做网站时有没有遇到过这样的问题：想保留链接的背景，但又要链接里的文字消失！可是弄了...q与cite标签的应用 (1)前面的文章里园子给大家介绍过：strong和em标签的应用，大家知道这两个标签有一些相似之处...abbr和acronym标签的使用 (2)很多人都喜欢使用缩略词来表述特定的事物或是事件，这样做的好处是方便快递地传达信息，而不用每次...<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="XHTML代码规范" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F7.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F65.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;">XHTML代码规范</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="XHTML详解" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F58.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F65.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;">XHTML详解</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="最简单的海报制作工具：Poster Forge" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fposter-maker.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F65.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/08/12/21172615.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;">最简单的海报制作工具：Poster Forge</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="最简单的Flash生成工具：SWFText汉化版下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F318.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F65.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/08/08/5572726.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;">最简单的Flash生成工具：SWFText汉化版下载</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="用 QQ 邮箱制作漂亮的明信片" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F324.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F65.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/4292481.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;">用 QQ 邮箱制作漂亮的明信片</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/category/xhtml" title="xhtml">xhtml</a></span>标签是不太常用的，今天<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/about" title="园子" rel="nofollow">园子</a></span>把使用频率较少但又有些代表性的几个标签给大家分享一下。<br />
<span id="more-34785"></span></p>
<ul>
<li><strong>kdb标签</strong><br />
表示由用户从键盘输入的文字，例如：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;p&gt;在浏览器的地址栏打上&lt;kbd&gt;www.yzznl.cn&lt;/kbd&gt;。&lt;/p&gt;</pre></div></div>

<p>但是，也有人把他理解成用户从键盘输入的按键，例如：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;p&gt;按&lt;kbd&gt;Tab&lt;/kbd&gt;测试一下&lt;/p&gt;</pre></div></div>

<p>并能过用<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/css" title="css">css</a></span>把&lt;kdb /&gt;定义得有点像键盘按键，如下图：</p>
<p><img src="http://www.yzznl.cn/wp-content/uploads/2009/02/tab.gif" alt="关于kdb标签的示例图" /></p>
<p>对于这个这元素，W3C的文档并没有怎样说明，也没有例子参考，谁对谁错也很难说清。园子个人更倾向把它用于定义键盘按键，或者可以这样理解，如果&lt;kbd&gt;里面的是键盘上有的（比如Tab、Esc、Backspace等）就是直接按键盘上的键，如果不是键盘上的键名的（比如网址、文字等），就由单个字母输入完成。但是这样可能会有些冲突，例如Home，是让输入Home还是按Home键呢？也许这时应该再加上title提示会更好。</li>
<li><strong>code &amp; var标签</strong><br />
在(X)HTML中，有专门对代码进行标识的标签，那就是&lt;code&gt;&lt;/code&gt;，例如：你可以用&lt;code&gt;code&lt;/code&gt;标签来表示计算机（程序）代码。而var是定义一个变量名，例如计算机程序的变量、数学函数的变量等。例如：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;code&gt;&lt;var&gt;wordcount&lt;/var&gt; = 6878;&lt;/code&gt;</pre></div></div>

</li>
<li><strong>pre标签</strong><br />
上面说了code标签的用法，或许你会发现紧紧&lt;code&gt;是不够用的，因为代码都是一行一行的，如果你只用&lt;code&gt;的话，所有用它来标识的代码，就会堆到一行去，这又是为什么呢？因为，&lt;code&gt;是inline-level（行内元素）的，行内元素是不换行的。这就有必要说下pre标签。<br />
pre标签标签在Dreamweaver中被称为“格式化”，在以前使用Dreamweaver 的时候我一直不清楚这个东西是作什么用的。一直到现在才清楚pre通常用以显示源代码，并且不支持能使段落分开的标签比如&lt;p&gt;，显示内容如需换行只要在源文件中换行即可无需要代码实现。同时pre会保留注其中的所有空格并显示出来。一般来讲pre目前是多用于显示源代码，这与code的用途是相似的，所不同的是pre是块级的，而code是内联的。简单说，pre可以包括多行内容，而code只包含短小的一句或几个字符。</li>
<li><strong>samp标签</strong><br />
samp标签用于定义一个“输出”的内容，例如：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;p&gt;你只要点删除，网页就会提示&lt;samp&gt;该会话已移至“已删除邮件”&lt;/samp&gt;。&lt;/p&gt;</pre></div></div>

</li>
<li><strong>sup与sub标签</strong><br />
你还记得上标和下标吗？在所有的标签中有两上标签是样式标签，但是却没有被禁用，因为这两个标签所表述的内容很特别，上下标，&lt;sup&gt;上标&lt;/sup&gt;,&lt;sub&gt;下标&lt;/sub&gt;。这两个标签用得到机率比较小，但是上标应该还是会常用到的，比如温度中的摄氏度的上的小圆圈，当然现有有专业的字符对应“℃”，还有我们常看到书中的脚注上标等等。</li>
<li><strong>hr与br标签</strong><br />
hr，分平分隔线；<br />
br，常用的换行符。<br />
这两个标签只要注意标签的写法就可以了，很多粗心的人都不小心的把写错了，&lt;hr /&gt;和&lt;br /&gt;，要提醒你的是这两个都是单标签，记得后面要闭合。</li>
</ul>
<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/225.html" title="详解rel=”nofollow”的用法与意义">详解rel=”nofollow”的用法与意义</a> (9)<br /><small>近年来在网站的链接中我们经常会看到类似rel="nofollow"或rel="externa...</small></li><li><a href="http://www.yzznl.cn/archives/72.html" title="网页中表单的使用技巧">网页中表单的使用技巧</a> (0)<br /><small>本文园子总结了在网页常用布局中表单的一些使用技巧，可以帮助你更灵活的控制表单，使页面更加人性...</small></li><li><a href="http://www.yzznl.cn/archives/71.html" title="语义化表单里的标签">语义化表单里的标签</a> (0)<br /><small>表单是用户提交信息的重要渠道，是(X)HTML的一个重要部分。表单主要用于采集和提交用户输入...</small></li><li><a href="http://www.yzznl.cn/archives/70.html" title="丰富表格里的标签">丰富表格里的标签</a> (1)<br /><small>表格，一个在网页设计中比较经典的工具。曾经，表格是网页设计人最重要的布局排版手段，但是它的存...</small></li><li><a href="http://www.yzznl.cn/archives/69.html" title="定义列表dl,dt,dd的用法">定义列表dl,dt,dd的用法</a> (2)<br /><small>上篇文章给大家分享了无序列表和有序列表的用法，其实一般我们在做列表的时候通常只会用到ul和l...</small></li><li><a href="http://www.yzznl.cn/archives/68.html" title="无序列表和有序列表的用法">无序列表和有序列表的用法</a> (0)<br /><small>首先先来看个截图：



这种以列表形式来显示的内容在网页中称为列表，相信大家都经常...</small></li><li><a href="http://www.yzznl.cn/archives/67.html" title="h1~h6的使用原则">h1~h6的使用原则</a> (2)<br /><small>在遵循<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="网页标准">网页标准</a></span>制作网页的时候，为了使得设计更具有语义化，我们经常会在页面中用到h1~h6的标...</small></li><li><a href="http://www.yzznl.cn/archives/66.html" title="以图换字方法和思路">以图换字方法和思路</a> (2)<br /><small>不知道您在做网站时有没有遇到过这样的问题：想保留链接的背景，但又要链接里的文字消失！可是弄了...</small></li><li><a href="http://www.yzznl.cn/archives/64.html" title="q与cite标签的应用">q与cite标签的应用</a> (1)<br /><small>前面的文章里园子给大家介绍过：strong和em标签的应用，大家知道这两个标签有一些相似之处...</small></li><li><a href="http://www.yzznl.cn/archives/61.html" title="abbr和acronym标签的使用">abbr和acronym标签的使用</a> (2)<br /><small>很多人都喜欢使用缩略词来表述特定的事物或是事件，这样做的好处是方便快递地传达信息，而不用每次...</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="XHTML代码规范" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F7.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F65.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;">XHTML代码规范</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="XHTML详解" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F58.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F65.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;">XHTML详解</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%2Ftianjiayan.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F65.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/4289769.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="WordPress CommentLuv 插件：同步显示评论者的最新文章" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F386.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F65.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/4292092.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;">WordPress CommentLuv 插件：同步显示评论者的最新文章</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="如何查看一个IP地址下放了多少个网站，同IP网站查询方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Fwebsite-with-the-ip-method.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F65.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/4291570.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;">如何查看一个IP地址下放了多少个网站，同IP网站查询方法</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/65.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>q与cite标签的应用</title>
		<link>http://www.yzznl.cn/archives/64.html</link>
		<comments>http://www.yzznl.cn/archives/64.html#comments</comments>
		<pubDate>Fri, 20 Feb 2009 03:06:19 +0000</pubDate>
		<dc:creator>园子</dc:creator>
				<category><![CDATA[Xhtml]]></category>

		<guid isPermaLink="false">http://www.yzznl.cn/archives/64.html</guid>
		<description><![CDATA[前面的文章里园子给大家介绍过：strong和em标签的应用，大家知道这两个标签有一些相似之处。其实在xhtml里面还有很多用途比较相似的标签，比如q、cite、blockquote。这三个都属于引用一类，但是这里还是有一些区别的，首先来一一解释。 &#60;q&#62;&#60;/q&#62;，q的作用是引用非块元素，也就是引用不能形成段落的内容，可能是某人说的一句话，也可能是一句文档摘录等，特点很明显这里是“一句”。并且q本身并不会产生段落。q本身并没有什么样式，一般浏览器也不会给他设置一个默认样式使起突出。但是我们可以通过css去使之与一般内容区分开。在q标签中还有一个属性是非常重要的，那就是cite。在这个cite属性值中主要是注明引用内容的出自何处，或是给出在线的地址。例如： &#60;q cite=”http://www.yzznl.cn/archives/55.html”&#62;strong与em相信大家一定不会陌生，园子为什么一次要介绍两个标签呢？&#60;/q&#62; 请注意不要把q写成p，这两个标签很容易弄错。 关于cite标签，园子认为此标签的应用在于标注出文献的标题与名称。这个标签有点类似于我们书籍后面的参考文献的目录内容，也有点像是脚注。那么他与q之间的区别是什么呢？其实很容易理解，q是显示内容，而cite则是显示说这段内容的人名或是书名。cite与q常常混合起来使用。例如： &#60;cite&#62;鲁迅&#60;/cite&#62;先生说：&#60;q&#62;地上本来没有路，走得人多了，便有了路&#60;/q&#62; 那么blockquote与q、cite又有什么区别呢？ 相信大家在论坛网友的帖子上面经常能看到“引用”这个功能，这就是blockquote，blockquote是块引用，XHTML允许其包含任何标签。而上面的q与cite则没有这么大的包容度。blockquote的使用是当需要引用一段或是多段内容时所采用的，浏览器一般默认处理会把引用内容缩进一些以与正常的段落文章区分开。当然我们可以通过CSS样式来改变区分的形式。 在blockquote中也有一个cite属性，与q一样是用来注明引用来源的。可以把联机文档的URL注明在其中。 扩展阅读详解rel=”nofollow”的用法与意义 (9)近年来在网站的链接中我们经常会看到类似rel="nofollow"或rel="externa...网页中表单的使用技巧 (0)本文园子总结了在网页常用布局中表单的一些使用技巧，可以帮助你更灵活的控制表单，使页面更加人性...语义化表单里的标签 (0)表单是用户提交信息的重要渠道，是(X)HTML的一个重要部分。表单主要用于采集和提交用户输入...丰富表格里的标签 (1)表格，一个在网页设计中比较经典的工具。曾经，表格是网页设计人最重要的布局排版手段，但是它的存...定义列表dl,dt,dd的用法 (2)上篇文章给大家分享了无序列表和有序列表的用法，其实一般我们在做列表的时候通常只会用到ul和l...无序列表和有序列表的用法 (0)首先先来看个截图： 这种以列表形式来显示的内容在网页中称为列表，相信大家都经常...h1~h6的使用原则 (2)在遵循网页标准制作网页的时候，为了使得设计更具有语义化，我们经常会在页面中用到h1~h6的标...以图换字方法和思路 (2)不知道您在做网站时有没有遇到过这样的问题：想保留链接的背景，但又要链接里的文字消失！可是弄了...一些少用的XHTML标签 (0)在我们的实际应用中，还有一些XHTML标签是不太常用的，今天园子把使用频率较少但又有些代表性...abbr和acronym标签的使用 (2)很多人都喜欢使用缩略词来表述特定的事物或是事件，这样做的好处是方便快递地传达信息，而不用每次...<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="wbr和nobr标签的应用" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F56.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F64.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/4290721.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;">wbr和nobr标签的应用</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="TipsExtend.exe – 应用程序错误的解决方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftipsextendexe-application-error-solution.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F64.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/4293892.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;">TipsExtend.exe – 应用程序错误的解决方法</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%2Fweixin.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F64.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/05/02/7262525.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="br标签的应用" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F54.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F64.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;">br标签的应用</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="strong和em标签的应用" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F55.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F64.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;">strong和em标签的应用</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="strong和em标签的应用" href="http://www.yzznl.cn/archives/55.html">strong和em标签的应用</a>，大家知道这两个标签有一些相似之处。其实在<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/xhtml" title="xhtml">xhtml</a></span>里面还有很多用途比较相似的标签，比如<strong>q</strong>、<strong>cite</strong>、<strong>blockquote</strong>。这三个都属于引用一类，但是这里还是有一些区别的，首先来一一解释。<br />
<span id="more-34668"></span></p>
<p>&lt;q&gt;&lt;/q&gt;，q的作用是引用非块元素，也就是引用不能形成段落的内容，可能是某人说的一句话，也可能是一句文档摘录等，特点很明显这里是“一句”。并且q本身并不会产生段落。q本身并没有什么样式，一般浏览器也不会给他设置一个默认样式使起突出。但是我们可以通过<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/css" title="css">css</a></span>去使之与一般内容区分开。在q标签中还有一个属性是非常重要的，那就是cite。在这个cite属性值中主要是注明引用内容的出自何处，或是给出在线的地址。例如：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;q cite=”http://www.yzznl.cn/archives/55.html”&gt;strong与em相信大家一定不会陌生，园子为什么一次要介绍两个标签呢？&lt;/q&gt;</pre></div></div>

<p>请注意不要把q写成p，这两个标签很容易弄错。</p>
<p>关于cite标签，园子认为此标签的应用在于标注出文献的标题与名称。这个标签有点类似于我们书籍后面的参考文献的目录内容，也有点像是脚注。那么他与q之间的区别是什么呢？其实很容易理解，q是显示内容，而cite则是显示说这段内容的人名或是书名。cite与q常常混合起来使用。例如：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:Microsoft YaHei,Arial;">&lt;cite&gt;鲁迅&lt;/cite&gt;先生说：&lt;q&gt;地上本来没有路，走得人多了，便有了路&lt;/q&gt;</pre></div></div>

<p>那么blockquote与q、cite又有什么区别呢？</p>
<p>相信大家在论坛网友的帖子上面经常能看到“引用”这个功能，这就是blockquote，blockquote是块引用，XHTML允许其包含任何标签。而上面的q与cite则没有这么大的包容度。blockquote的使用是当需要引用一段或是多段内容时所采用的，浏览器一般默认处理会把引用内容缩进一些以与正常的段落文章区分开。当然我们可以通过CSS样式来改变区分的形式。</p>
<p>在blockquote中也有一个cite属性，与q一样是用来注明引用来源的。可以把联机文档的URL注明在其中。</p>
<h3  class="related_post_title">扩展阅读</h3><ul class="related_post"><li><a href="http://www.yzznl.cn/archives/225.html" title="详解rel=”nofollow”的用法与意义">详解rel=”nofollow”的用法与意义</a> (9)<br /><small>近年来在网站的链接中我们经常会看到类似rel="nofollow"或rel="externa...</small></li><li><a href="http://www.yzznl.cn/archives/72.html" title="网页中表单的使用技巧">网页中表单的使用技巧</a> (0)<br /><small>本文园子总结了在网页常用布局中表单的一些使用技巧，可以帮助你更灵活的控制表单，使页面更加人性...</small></li><li><a href="http://www.yzznl.cn/archives/71.html" title="语义化表单里的标签">语义化表单里的标签</a> (0)<br /><small>表单是用户提交信息的重要渠道，是(X)HTML的一个重要部分。表单主要用于采集和提交用户输入...</small></li><li><a href="http://www.yzznl.cn/archives/70.html" title="丰富表格里的标签">丰富表格里的标签</a> (1)<br /><small>表格，一个在网页设计中比较经典的工具。曾经，表格是网页设计人最重要的布局排版手段，但是它的存...</small></li><li><a href="http://www.yzznl.cn/archives/69.html" title="定义列表dl,dt,dd的用法">定义列表dl,dt,dd的用法</a> (2)<br /><small>上篇文章给大家分享了无序列表和有序列表的用法，其实一般我们在做列表的时候通常只会用到ul和l...</small></li><li><a href="http://www.yzznl.cn/archives/68.html" title="无序列表和有序列表的用法">无序列表和有序列表的用法</a> (0)<br /><small>首先先来看个截图：



这种以列表形式来显示的内容在网页中称为列表，相信大家都经常...</small></li><li><a href="http://www.yzznl.cn/archives/67.html" title="h1~h6的使用原则">h1~h6的使用原则</a> (2)<br /><small>在遵循<span class='wp_keywordlink_affiliate'><a href="http://www.yzznl.cn/category/standards-web" title="网页标准">网页标准</a></span>制作网页的时候，为了使得设计更具有语义化，我们经常会在页面中用到h1~h6的标...</small></li><li><a href="http://www.yzznl.cn/archives/66.html" title="以图换字方法和思路">以图换字方法和思路</a> (2)<br /><small>不知道您在做网站时有没有遇到过这样的问题：想保留链接的背景，但又要链接里的文字消失！可是弄了...</small></li><li><a href="http://www.yzznl.cn/archives/65.html" title="一些少用的XHTML标签">一些少用的XHTML标签</a> (0)<br /><small>在我们的实际应用中，还有一些XHTML标签是不太常用的，今天园子把使用频率较少但又有些代表性...</small></li><li><a href="http://www.yzznl.cn/archives/61.html" title="abbr和acronym标签的使用">abbr和acronym标签的使用</a> (2)<br /><small>很多人都喜欢使用缩略词来表述特定的事物或是事件，这样做的好处是方便快递地传达信息，而不用每次...</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="wbr和nobr标签的应用" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F56.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F64.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/4290721.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;">wbr和nobr标签的应用</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="TipsExtend.exe – 应用程序错误的解决方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2Ftipsextendexe-application-error-solution.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F64.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/4293892.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;">TipsExtend.exe – 应用程序错误的解决方法</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%2Fweixin.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F64.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/05/02/7262525.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="br标签的应用" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F54.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F64.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;">br标签的应用</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="strong和em标签的应用" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F55.html&from=http%3A%2F%2Fwww.yzznl.cn%2Farchives%2F64.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;">strong和em标签的应用</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/64.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

