曝光臺(tái) 注意防騙
網(wǎng)曝天貓店富美金盛家居專營(yíng)店坑蒙拐騙欺詐消費(fèi)者
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>
你以前學(xué)過的可能是把<P>看作一個(gè)段落的結(jié)束,現(xiàn)在應(yīng)當(dāng)把它看作一個(gè)開始。這會(huì)帶來一些好處,例如可以方便地為一個(gè)
段落指定多種格式化屬性。例如,下面是可在http://thomas.loc.gov/home/hres581.html 上看到的 House Resolution 581
的原始HTML 標(biāo)題:
XML 實(shí)用大全
第 149 頁(yè)
<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>
下面是同樣的文本,但使用的是結(jié)構(gòu)完整的HTML。Align 屬性代替了相應(yīng)的center 元素,并且使用CSS 樣式屬性代替了<b>
標(biāo)記。
<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 刪除孤立的結(jié)束標(biāo)記并且不要使元素重疊
在編輯頁(yè)面時(shí),刪除一個(gè)起始標(biāo)記而忘了刪除相應(yīng)的結(jié)束標(biāo)記,這種情況很常見。在HTML 中,一個(gè)孤立的結(jié)束標(biāo)記如
</STRONG>或者</TD>沒有任何相匹配的起始標(biāo)記不會(huì)引發(fā)問題。但是這樣會(huì)使文件比需要的更長(zhǎng),下載速度變慢,而且潛在
地使人或工具理解和編輯HTML 源文件發(fā)生混淆。因此應(yīng)當(dāng)確保每個(gè)結(jié)束標(biāo)記都有正確的起始標(biāo)記。
但是結(jié)束標(biāo)記沒有任何起始標(biāo)記往往意味著那些元素錯(cuò)誤地重疊了。在Web 頁(yè)面上的大部分重疊元素很容易修改。例如下面
這種常見的錯(cuò)誤:
XML 實(shí)用大全
第 150 頁(yè)
<B><I>This text is bold and italic</B></I>
I 元素在B 元素中開始,也必須在B 元素中結(jié)束。需要做的只是交換兩個(gè)結(jié)束標(biāo)記的位置:
<B><I>This text is bold and italic</I></B>
同樣可以交換兩個(gè)起始標(biāo)記:
<I><B>This text is bold and italic</B></I>
偶爾會(huì)遇到一個(gè)棘手的問題。例如,下面是來自白宮主頁(yè)的一個(gè)片段(http://www.whitehouse.gov/,1998 年11 月4 日)。
其中已醒目地標(biāo)出了有問題的標(biāo)記,很容易看出錯(cuò)誤所在:
<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 實(shí)用大全
第 151 頁(yè)
其中,<FONT size=+1>元素在第一個(gè)<TD valign=TOP width=85>元素中開始,但是它的后續(xù)部分越過該元素結(jié)束于另一個(gè)<TD
valign=TOP width=225>元素中。在此情況下,正確的處理方法是在第一個(gè)</TD>結(jié)束標(biāo)記之前立即結(jié)束<FONT size=+1>起始
標(biāo)記,然后在第二個(gè)TD 元素開始之后立即添加一個(gè)新的<FONT size=+1>起始標(biāo)記,如下所示:
<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>
中國(guó)航空網(wǎng) m.k6050.com
航空翻譯 www.aviation.cn
本文鏈接地址:
XML實(shí)用大全(47)