<?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>YSlove.net &#187; xhtml</title>
	<atom:link href="http://yslove.net/tag/xhtml/feed/" rel="self" type="application/rss+xml" />
	<link>http://yslove.net</link>
	<description>Playing Keyboard</description>
	<lastBuildDate>Fri, 27 Jan 2012 06:20:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>符合XHTML Strict 1.0 W3C组织标准的标签与结构</title>
		<link>http://yslove.net/2009/08/xhtml-strict-1-0-structural-element/</link>
		<comments>http://yslove.net/2009/08/xhtml-strict-1-0-structural-element/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 07:53:00 +0000</pubDate>
		<dc:creator>YSjia</dc:creator>
				<category><![CDATA[try it]]></category>
		<category><![CDATA[实验室]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://yslove.net/?p=404</guid>
		<description><![CDATA[选择适当的标签与合理的结构，将是构建一个标准网站的基础]]></description>
			<content:encoded><![CDATA[<h3>合理标签</h3>
<div class="shortcuts">
<p><strong>结构</strong>       <br /><code>html</code><code>head</code><code>body</code><code>div</code><code>span</code></p>
<p><strong>元信息</strong>       <br /><code>DOCTYPE</code><code>title</code><code>link</code><code>meta</code><code>style</code></p>
<p><strong>文本</strong>       <br /><code>p</code><code>h1</code><code>h2</code><code>h3</code><code>h4</code><code>h5</code><code>h6</code><code>strong</code><code>em</code><code>abbr</code><code>acronym</code><code>address</code><code>bdo</code><code>blockquote</code><code>cite</code><code>q</code><code>code</code><code>ins</code><code>del</code>       <br /><code>dfn</code><code>kbd</code><code>pre</code><code>samp</code><code>var</code><code>br</code></p>
<p><strong>链接        <br /></strong><code>a</code><code>base</code></p>
<p><strong>图像和对象</strong>       <br /><code>img</code><code>area</code><code>map</code><code>object</code><code>param</code></p>
<p><strong>列表 </strong>      <br /><code>ul</code><code>ol</code><code>li</code><code>dl</code><code>dt</code><code>dd</code></p>
<p><strong>表格 </strong>      <br /><code>table</code><code>tr</code><code>td</code><code>th</code><code>tbody</code><code>thead</code><code>tfoot</code><code>col</code><code>colgroup</code><code>caption</code></p>
<p><strong>表单 </strong>      <br /><code>form</code><code>input</code><code>textarea</code><code>select</code><code>option</code><code>optgroup</code><code>button</code><code>label</code><code>fieldset</code><code>legend</code></p>
<p><strong>脚本 </strong>      <br /><code>script</code><code>noscript</code></p>
<p><strong>表现 </strong>      <br /><code>b</code><code>i</code><code>tt</code><code>sub</code><code>sup</code><code>big</code><code>small</code><code>hr</code></p>
</p></div>
<h3>合理的结构</h3>
<p>HTML </p>
<div class="code shortcuts">
<ul>
<li><a name="head">HEAD</a>
<ul>
<li>TITLE <i>(required)</i> </li>
<li>SCRIPT, STYLE
<ul>
<li>CDATA </li>
</ul>
</li>
<li>BASE, META, LINK <i>(empty)</i> </li>
<li>OBJECT <i>(see content model below)</i> </li>
</ul>
</li>
<li><a name="body">BODY</a>
<ul>
<li>INS, DEL <i>(special rules apply)</i>
<ul>
<li><strong><a name="flow">flow</a></strong>
<ul>
<li>block </li>
<li>inline </li>
</ul>
</li>
</ul>
</li>
<li>SCRIPT
<ul>
<li>CDATA </li>
</ul>
</li>
<li><strong>block</strong>
<ul>
<li>P, H1, H2, H3, H4, H5, H6
<ul>
<li><strong>inline</strong>
<ul>
<li>#PCDATA </li>
<li>TT, I, B, BIG, SMALL, EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ABBR, ACRONYM, SUB, SUP, Q, SPAN, BDO
<ul>
<li>inline </li>
</ul>
</li>
<li>A
<ul>
<li>inline <i>excluding an enclosed A element</i> </li>
</ul>
</li>
<li><a name="object">OBJECT</a>
<ul>
<li>PARAM <i>(empty)</i> </li>
<li>flow </li>
</ul>
</li>
<li>IMG, BR <i>(empty)</i> </li>
<li>SCRIPT
<ul>
<li>CDATA </li>
</ul>
</li>
<li>MAP
<ul>
<li>AREA <i>(empty)</i> </li>
<li>block </li>
</ul>
</li>
<li>INPUT <i>(empty)</i> </li>
<li>SELECT
<ul>
<li>OPTGROUP
<ul>
<li>OPTION </li>
</ul>
</li>
<li>OPTION </li>
</ul>
</li>
<li>TEXTAREA </li>
<li>LABEL
<ul>
<li>LABEL <i>excluding enclosed LABEL</i> </li>
</ul>
</li>
<li>BUTTON
<ul>
<li>flow <i>excluding A, INPUT, SELECT, TEXTAREA, LABEL, BUTTON, FORM, FIELDSET</i> </li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li>UL, OL
<ul>
<li>LI
<ul>
<li>flow </li>
</ul>
</li>
</ul>
</li>
<li>DL
<ul>
<li>DT
<ul>
<li>inline </li>
</ul>
</li>
<li>DD
<ul>
<li>flow </li>
</ul>
</li>
</ul>
</li>
<li>PRE
<ul>
<li>inline <i>excluding IMG, OBJECT, BIG, SMALL, SUB, SUP</i> </li>
</ul>
</li>
<li>DIV
<ul>
<li>flow </li>
</ul>
</li>
<li>BLOCKQUOTE
<ul>
<li>block </li>
<li>SCRIPT
<ul>
<li>CDATA </li>
</ul>
</li>
</ul>
</li>
<li>NOSCRIPT
<ul>
<li>flow </li>
</ul>
</li>
<li>FORM
<ul>
<li>block <i>excluding an enclosed FORM</i> </li>
<li>SCRIPT
<ul>
<li>CDATA </li>
</ul>
</li>
</ul>
</li>
<li>HR <i>(empty)</i> </li>
<li>TABLE
<ul>
<li>CAPTION
<ul>
<li>inline </li>
</ul>
</li>
<li>COLGROUP
<ul>
<li>COL <i>(empty)</i> </li>
</ul>
</li>
<li>COL <i>(empty)</i> </li>
<li>THEAD, TBODY, TBODY
<ul>
<li>TR
<ul>
<li>TH, TD
<ul>
<li>flow </li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li>ADDRESS
<ul>
<li>inline </li>
</ul>
</li>
<li>FIELDSET
<ul>
<li>#PCDATA </li>
<li>inline </li>
<li>flow </li>
<li>LEGEND
<ul>
<li>inline </li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul></div>
<p>结构来总结来自:<a href="http://www.cs.tut.fi/~jkorpela/html/strict.html" target="_blank">Allowed nesting of elements in HTML 4 Strict (and XHTML 1.0 Strict)</a></p>
<p>结构说明原文（英文翻译不咋的，不想误人子弟，所以不是请大家自己看吧）：</p>
<blockquote class="small"><li>An uppercase word stands for the corresponding element. (Note that by <a href="http://www.w3.org/TR/xhtml1/">XHTML</a> rules, element names must be written in lower case, e.g. <code>&lt;html&gt;</code>, not <code>&lt;HTML&gt;</code>.) </li>
<li>A lowercase word is a term which describes a collection of HTML elements. </li>
<li>Each entry is followed by a list of elements which may appear within the elements specified by the entry. If there is no such list, no nested elements are allowed. This means that only text (#PCDATA, see next item) is allowed inside the element; but if the note <i>(empty)</i> is given, it means that no content whatsoever is allowed. However, for <strong>flow</strong>, <strong>inline</strong>, <strong>block</strong>, <strong>OBJECT</strong>, and <strong>BODY</strong> the allowed contents are described separately under the main entries for them. </li>
<li><a href="http://www.webreference.com/dlab/books/html/3-5.html#3-5-2-2">#PCDATA</a> means &quot;parsed character data&quot;, which is plain text (without HTML tags, but &quot;<a href="http://www.cs.tut.fi/%7Ejkorpela/HTML3.2/3.10.html#esc">escape sequences</a>&quot; such as <code>&amp;auml;</code> and <code>&amp;#228;</code> are allowed) </li>
<li><a href="http://www.w3.org/TR/html4/types.html#type-cdata">CDATA</a> means &quot;character data&quot;, which is plain text where even &quot;escape sequences&quot; aren&#8217;t interpreted; for a much better explanation, see the article <cite><a href="http://www.flightlab.com/%7Ejoe/sgml/cdata.html">CDATA Confusion</a></cite> by <a href="http://www.flightlab.com/%7Ejoe/">Joe English</a> </li>
<li><i>excluding</i> &#8230; means that the element must not contain any of the listed elements, directly or indirectly. </li>
</blockquote>
<hr /><h2>也许这些文章您也感兴趣:</h2><ul><li><a href="http://yslove.net/2009/09/font-end-qanda-1/" rel="bookmark" title="Permanent Link: 前端开发常见问题（非js）与解决方案">前端开发常见问题（非js）与解决方案</a></li><li><a href="http://yslove.net/2009/07/css-specificity/" rel="bookmark" title="Permanent Link: CSS权重（优先级）">CSS权重（优先级）</a></li><li><a href="http://yslove.net/2009/07/css-clear-float/" rel="bookmark" title="Permanent Link: CSS清除浮动详解">CSS清除浮动详解</a></li><li><a href="http://yslove.net/2010/04/jquery-find-filter-are-different/" rel="bookmark" title="Permanent Link: [jquery]find与filter的应用">[jquery]find与filter的应用</a></li><li><a href="http://yslove.net/2009/05/javascript-function/" rel="bookmark" title="Permanent Link: javascript-函数">javascript-函数</a></li></ul><hr /><small>Copyright &copy; 2010 by <a href="http://yslove.net">YSlove.net</a><br /><a href="http://yslove.net/2009/08/xhtml-strict-1-0-structural-element/#comments" title="留言">欢迎留言</a> | 作者: <a href="" >YSjia</a> | 原文链接：<a href="http://yslove.net/2009/08/xhtml-strict-1-0-structural-element/">http://yslove.net/2009/08/xhtml-strict-1-0-structural-element/</a><br /><em>数字指纹 3abf2858e3aa210a1750056317836753 (38.107.179.209) </em></small>]]></content:encoded>
			<wfw:commentRss>http://yslove.net/2009/08/xhtml-strict-1-0-structural-element/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CSS清除浮动详解</title>
		<link>http://yslove.net/2009/07/css-clear-float/</link>
		<comments>http://yslove.net/2009/07/css-clear-float/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 07:08:00 +0000</pubDate>
		<dc:creator>YSjia</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[实验室]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://yslove.net/?p=388</guid>
		<description><![CDATA[什么是浮动(floats)？ 当该属性不等于 none 引起对象浮动时，对象将被视作块对象( block-level )，即 display 属性等于 block 。也就是说，浮动对象的 display 属性将被忽略。跟随浮动对象的对象将移动到浮动对象的位置。浮动对象会向左或向右移动直到遇到边框( border 、内补丁( padding 、外补丁( margin 或者另一个块对象( block-level )为止。在IE5+中， div 和 span 对象假如没有指定宽度会被分配默认的宽度，而在此前的浏览器版本中则必须指定宽度值才可以呈递此属性。此属性对于 currentStyle 对象而言是只读的。对于其他对象而言是可读写的。对应的脚本特性为 styleFloat 。 浮动(floats)有何用？ 浮动可以说是为排版旦生的。如页面排版和图文排版，后者大家可能更清楚。MS Office最被人认同与最高使用的就是排版，其理论上与此相同，但是实现更为复杂。 （图片来自w3c.org） e.g. style: IMG { float: left } BODY, P, IMG { margin: 2em } HTML: &#60;p&#62;&#60;img alt="This image will illustrate floats" src="img.gif" /&#62; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>什么是浮动(floats)？</strong></p>
<p class="intro">当该属性不等于 none 引起对象浮动时，对象将被视作块对象( block-level )，即 display 属性等于 block 。也就是说，浮动对象的 display 属性将被忽略。跟随浮动对象的对象将移动到浮动对象的位置。浮动对象会向左或向右移动直到遇到边框( border 、内补丁( padding 、外补丁( margin 或者另一个块对象( block-level )为止。在IE5+中， div 和 span 对象假如没有指定宽度会被分配默认的宽度，而在此前的浏览器版本中则必须指定宽度值才可以呈递此属性。此属性对于 currentStyle 对象而言是只读的。对于其他对象而言是可读写的。对应的脚本特性为 styleFloat 。</p>
<p><strong>浮动(floats)有何用？</strong></p>
<p>浮动可以说是为排版旦生的。如页面排版和图文排版，后者大家可能更清楚。MS Office最被人认同与最高使用的就是排版，其理论上与此相同，但是实现更为复杂。</p>
<p><img style="display: inline; border-width: 0px;" title="floateg" src="http://gd.yslove.net/CSS_A7E0/floateg.gif" border="0" alt="floateg" width="352" height="225" /><br />
<em>（图片来自w3c.org） </em></p>
<p><em>e.g.</em></p>
<p>style:</p>
<pre class="brush:css">IMG { float: left }
BODY, P, IMG { margin: 2em }</pre>
<p>HTML:</p>
<pre class="brush:xhtml">&lt;p&gt;&lt;img alt="This image will illustrate floats" src="img.gif" /&gt;
Some sample text that has no other...&lt;/p&gt;</pre>
<p>需要注意的是带有浮动属性的盒子(box)，其外边距是不可叠加的。</p>
<p>但是在正常的文档流里面出现代有浮动属性的块级(block)时，就会出现重叠的现象。</p>
<p><img style="display: inline; border-width: 0px;" title="float2p" src="http://gd.yslove.net/CSS_A7E0/float2p.gif" border="0" alt="float2p" width="320" height="315" /></p>
<p><em>（图片来自w3c.org） </em></p>
<p>这样的事情有时我们不想让他发生，所以就需要清除浮动(clear)。</p>
<p>注意在Quirks Mode下是不需要清除浮动的。</p>
<p><strong>清除浮动(clear)</strong></p>
<p>清除浮动就是让盒子处在一种‘闭合’的状态。</p>
<p><strong><em>1</em></strong>.添加‘封底’标签。</p>
<p><em>e.g.</em></p>
<pre class="brush:xhtml">&lt;div class=’container’&gt;
    &lt;div style=’float:left’&gt;&lt;/div&gt;
    &lt;div style=’float:right;’&gt;&lt;/div&gt;
    &lt;div style=’clear:both’&gt;&lt;/div&gt;
&lt;/div&gt;</pre>
<p>这样在底部会有一个clear属性的div标签（当然你也可以用其他的任何透明的标签），来保证整个container盒子处在‘闭合’状态。</p>
<p>这种好处在于没有破坏标签本意，可读性比较强</p>
<p>坏处在于会多一些代码。</p>
<p><strong><em>2</em></strong>.用<strong>:after</strong>伪类<br />
<em>e.g.</em></p>
<pre class="brush:xhtml">&lt;div class=’container’&gt;
    &lt;div style=’float:left’&gt;&lt;/div&gt;
    &lt;div style=’float:right;’&gt;&lt;/div&gt;
&lt;/div&gt;</pre>
<p>代码如下：</p>
<pre class="brush:css">.clearfix:after{
    clear:both;
    content:".";
    display:block;
    height:0;
    visibility:hidden;
}

.clearfix{
    display:inline-block;/*fix ie7*/
}

*html .clearfix{
    height:1%;
}

.clearfix{
    display:block;
}</pre>
<p>这样的代码已经可以运行于大部分非IE浏览器，但是为什么这里会用<strong>*</strong>呢？</p>
<p>这里的*适用于IE7与IE MAC。</p>
<p>但是还有个别浏览器不行，如opera9.5。</p>
<p>因为这里:after后面的是visibility:hidden，这样并不能将content里面的“.”隐藏，所以还需要一些hack!</p>
<p>在伪类里添加如下代码：</p>
<pre class="brush:css">font-size:0px;
line-height:0px;</pre>
<p>这样就OK~</p>
<p><strong><em>3</em></strong>.利用overfloat属性</p>
<p>利用overfloat属性可以很简单的解决浮动问题，除ie6以外的浏览器几乎都支持。</p>
<p>使用方法，就是在浮动标签上加上overfloat:auto这个属性即可(在ie6中可以用zoom属性)，如上面的container即为</p>
<pre class="brush:css">.container{overfloat:auto;_zoom:1;}</pre>
<p>这样一段代码就OK~</p>
<p>但是overfloat属性的本意并不在此，所以在某些情况下会出现层级问题，还是要慎用。</p>
<p>用zoom方法是不可以通过W3C的，但是也是最有效的方法。</p>
<p>以上方法没有单一完全适用的通用方法，都是要靠大家在应用中灵活运用，才能达到最理想的效果~^_^</p>
<hr /><h2>也许这些文章您也感兴趣:</h2><ul><li><a href="http://yslove.net/2009/09/ie6-background-width-position-bug/" rel="bookmark" title="Permanent Link: IE6特殊的Bug">IE6特殊的Bug</a></li><li><a href="http://yslove.net/2009/10/nds-new-character-coming/" rel="bookmark" title="Permanent Link: 特稿 暴风雨前的宁静 老任新主机的可能性">特稿 暴风雨前的宁静 老任新主机的可能性</a></li><li><a href="http://yslove.net/2010/03/funny-01/" rel="bookmark" title="Permanent Link: 你太让我失望了。你应该比谁都看得清红色!">你太让我失望了。你应该比谁都看得清红色!</a></li><li><a href="http://yslove.net/2009/10/number-9/" rel="bookmark" title="Permanent Link: 《9》">《9》</a></li><li><a href="http://yslove.net/2009/09/shapeofmyheart/" rel="bookmark" title="Permanent Link: Shape of My Heart">Shape of My Heart</a></li></ul><hr /><small>Copyright &copy; 2010 by <a href="http://yslove.net">YSlove.net</a><br /><a href="http://yslove.net/2009/07/css-clear-float/#comments" title="留言">欢迎留言</a> | 作者: <a href="" >YSjia</a> | 原文链接：<a href="http://yslove.net/2009/07/css-clear-float/">http://yslove.net/2009/07/css-clear-float/</a><br /><em>数字指纹 3abf2858e3aa210a1750056317836753 (38.107.179.209) </em></small>]]></content:encoded>
			<wfw:commentRss>http://yslove.net/2009/07/css-clear-float/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  yslove.net/tag/xhtml/feed/ ) in 0.56376 seconds, on Feb 6th, 2012 at 10:08 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 6th, 2012 at 11:08 am UTC -->
