• 热门标签

当前位置: 主页 > 航空资料 > 计算机 >

时间:2010-08-09 13:24来源:蓝天飞行翻译 作者:admin
曝光台 注意防骗 网曝天猫店富美金盛家居专营店坑蒙拐骗欺诈消费者

whether societies of men are really capable or not of
establishing good government from reflection and choice,or
whether they are forever destined to depend for their political
constitutions on accident and force.If there be any truth in
the remark,the crisis at which we are arrived may with
propriety be regarded as the era in which that decision is to
be made;and a wrong election of the part we shall act may,in
this view,deserve to be considered as the general misfortune
of mankind.
</P>
你以前学过的可能是把<P>看作一个段落的结束,现在应当把它看作一个开始。这会带来一些好处,例如可以方便地为一个
段落指定多种格式化属性。例如,下面是可在http://thomas.loc.gov/home/hres581.html 上看到的 House Resolution 581
的原始HTML 标题:
XML 实用大全
第 149 页
<center>
<p><h2>House Calendar No.272</h2>
<p><h1>105TH CONGRESS 2D SESSION H.RES.581</h1>
<p>[Report No.105-795 ]
<p><b>Authorizing and directing the Committee on the
Judiciary to investigate whether sufficient grounds
exist for the impeachment of William Jefferson Clinton,
President of the United States.</b>
</center>
下面是同样的文本,但使用的是结构完整的HTML。Align 属性代替了相应的center 元素,并且使用CSS 样式属性代替了<b>
标记。
<h2 align="center">House Calendar No.272</h2>
<h1 align="center">105TH CONGRESS 2D SESSION H.RES.581</h1>
<p align="center">[Report No.105-795 ]</p>
<p align="center" style="font-weight:bold">
Authorizing and directing the Committee on the Judiciary to
investigate whether sufficient grounds exist for the
impeachment of William Jefferson Clinton,
President of the United States.
</p>
6.4.1.2 删除孤立的结束标记并且不要使元素重叠
在编辑页面时,删除一个起始标记而忘了删除相应的结束标记,这种情况很常见。在HTML 中,一个孤立的结束标记如
</STRONG>或者</TD>没有任何相匹配的起始标记不会引发问题。但是这样会使文件比需要的更长,下载速度变慢,而且潜在
地使人或工具理解和编辑HTML 源文件发生混淆。因此应当确保每个结束标记都有正确的起始标记。
但是结束标记没有任何起始标记往往意味着那些元素错误地重叠了。在Web 页面上的大部分重叠元素很容易修改。例如下面
这种常见的错误:
XML 实用大全
第 150 页
<B><I>This text is bold and italic</B></I>
I 元素在B 元素中开始,也必须在B 元素中结束。需要做的只是交换两个结束标记的位置:
<B><I>This text is bold and italic</I></B>
同样可以交换两个起始标记:
<I><B>This text is bold and italic</B></I>
偶尔会遇到一个棘手的问题。例如,下面是来自白宫主页的一个片段(http://www.whitehouse.gov/,1998 年11 月4 日)。
其中已醒目地标出了有问题的标记,很容易看出错误所在:
<TD valign=TOP width=85>
<FONT size=+1>
<A HREF="/WH/New"><img border=0
src="/WH/images/pin_calendar.gif"
align=LEFT height=50 width=75 hspace=5 vspace=5></A><br></TD>
<TD valign=TOP width=225>
<A HREF="/WH/New"><B>What ’s New:</B></A><br>
</FONT>
What’s happening at the White <nobr>House -</nobr><br>
<font size=2><b>
<!-- New Begin -->
<a href="/WH/New/html/19981104-12244.html">Remarks Of The
President Regarding Social Security</a>
<BR>
<!-- New End -->
</font>
</b>
</TD>
XML 实用大全
第 151 页
其中,<FONT size=+1>元素在第一个<TD valign=TOP width=85>元素中开始,但是它的后续部分越过该元素结束于另一个<TD
valign=TOP width=225>元素中。在此情况下,正确的处理方法是在第一个</TD>结束标记之前立即结束<FONT size=+1>起始
标记,然后在第二个TD 元素开始之后立即添加一个新的<FONT size=+1>起始标记,如下所示:
<TD valign=TOP width=85>
<FONT size=+1>
<A HREF="/WH/New"><img border=0
src="/WH/images/pin_calendar.gif"
align=LEFT height=50 width=75 hspace=5 vspace=5></A><br>
</FONT></TD>
<TD valign=TOP width=225>
<FONT size=+1>
<A HREF="/WH/New"><B>What ’s New:</B></A><br>
</FONT>
What ’s happening at the White <nobr>House -</nobr><br>
<font size=2><b>
<!-- New Begin -->
<a href="/WH/New/html/19981104-12244.html">Remarks Of The
President Regarding Social Security</a>
<BR>
<!-- New End -->
</font>
 
中国航空网 www.aero.cn
航空翻译 www.aviation.cn
本文链接地址:XML实用大全(47)