濮阳杆衣贸易有限公司

主頁(yè) > 知識(shí)庫(kù) > XHTML與HTML之間的區(qū)別

XHTML與HTML之間的區(qū)別

熱門(mén)標(biāo)簽:電銷(xiāo)機(jī)器人的宣傳語(yǔ) 南通電話(huà)外呼系統(tǒng)開(kāi)發(fā) 江西防封卡外呼系統(tǒng)怎么安裝 石家莊電話(huà)機(jī)器人電話(huà) 400電話(huà)辦理安徽 電銷(xiāo)智能機(jī)器人靠譜么 北京銷(xiāo)售外呼系統(tǒng)線(xiàn)路 南寧外呼電銷(xiāo)系統(tǒng)招商 沸思外呼線(xiàn)路

翻譯:Linyupark

You can prepare yourself for XHTML by starting to write strict HTML.
你可以開(kāi)始通過(guò)書(shū)寫(xiě)嚴(yán)格的HTML代碼來(lái)為你的XHML之行做好準(zhǔn)備


--------------------------------------------------------------------------------

How To Get Ready For XHTML
如何為XHTML做準(zhǔn)備呢?
XHTML is the next generation of HTML, but it will of course take some time before browsers and other software products are ready for it.
XHTML是HTML的下一代語(yǔ)言,但它將理所當(dāng)然的在新的瀏覽器和其他的相關(guān)軟件產(chǎn)品出現(xiàn)之前延遲一段時(shí)間才能普及。

In the meantime there are some important things you can do to prepare yourself for it. As you will learn from this tutorial, XHTML is not very different from HTML 4.01, so bringing your code up to 4.01 standards is a very good start. Our complete HTML 4.01 reference can help you with that.
其間,去做一些重要的事情來(lái)為它做準(zhǔn)備。就像你可以從這教程學(xué)到東西一樣,XHTML與HTML4.01相差不多,所以把你的代碼改寫(xiě)成符合HTML4.01標(biāo)準(zhǔn)是一種非常好的開(kāi)始,我們完整的HTML4.01參考可以幫助你解決這個(gè)問(wèn)題。

In addition, you should start NOW to write your HTML code in lowercase letters, and NEVER make the bad habit of skipping end tags like the /p>.
另外,現(xiàn)在你應(yīng)該開(kāi)始用小寫(xiě)字母來(lái)書(shū)寫(xiě)你的HTML代碼,并且永遠(yuǎn)不要再像以前那樣有跳過(guò)像/p>這樣的結(jié)尾標(biāo)簽的壞習(xí)慣。

Happy coding!
快樂(lè)的編碼!


--------------------------------------------------------------------------------

The Most Important Differences:
非常重要的區(qū)別:
XHTML elements must be properly nested
XHTML元素必須合理嵌套
XHTML documents must be well-formed
XHTML文檔必須格式正確
Tag names must be in lowercase
標(biāo)簽名稱(chēng)必須是小寫(xiě)
All XHTML elements must be closed
所有XHTML元素必須關(guān)閉

--------------------------------------------------------------------------------

Elements Must Be Properly Nested
元素必須合理嵌套
In HTML some elements can be improperly nested within each other like this:
在HTML中一些元素可以不使用正確的相互嵌套像這樣:

b>i>This text is bold and italic/b>/i>In XHTML all elements must be properly nested within each other like this:
在XHTML所有元素必須合理的相互嵌套像這樣:

b>i>This text is bold and italic/i>/b>Note: A common mistake in nested lists, is to forget that the inside list must be within a li element, like this:
注意:在列表嵌套的時(shí)候經(jīng)常會(huì)犯一個(gè)錯(cuò)誤,就是忘記了在列表中插入的新列表必須在一個(gè)li>標(biāo)記中,像這樣:

ul>
  li>Coffee/li>
  li>Tea
    ul>
      li>Black tea/li>
      li>Green tea/li>
    /ul>
  li>Milk/li>
/ul>This is correct:
這才是正確的:

ul>
  li>Coffee/li>
  li>Tea
    ul>
      li>Black tea/li>
      li>Green tea/li>
    /ul>
  /li>
  li>Milk/li>
/ul>Notice that we have inserted a /li> tag after the /ul> tag in the "correct" code example.
在這段正確的代碼示例中,要注意在/ul>之后加了一個(gè)/li>標(biāo)簽


--------------------------------------------------------------------------------

Documents Must Be Well-formed
文檔格式必須合格
All XHTML elements must be nested within the html> root element. All other elements can have sub (children) elements. Sub elements must be in pairs and correctly nested within their parent element. The basic document structure is:
所有的XHTML標(biāo)記必須被嵌套使用在html> 根標(biāo)簽之中。所有其他的標(biāo)簽可以有自己的子標(biāo)簽。位于父標(biāo)簽之內(nèi)的子標(biāo)簽也必須成對(duì)且正確的嵌套使用。一個(gè)網(wǎng)頁(yè)的基本結(jié)構(gòu)是:

html>
head> ... /head>
body> ... /body>
/html>

--------------------------------------------------------------------------------

Tag Names Must Be In Lower Case
標(biāo)簽名稱(chēng)必須是小寫(xiě)
This is because XHTML documents are XML applications. XML is case-sensitive. Tags like br> and BR> are interpreted as different tags.
這是因?yàn)閄HTML文檔是XML應(yīng)用程序,XML是區(qū)分大小寫(xiě)的,像br>和BR>會(huì)被認(rèn)為是兩種不同的標(biāo)簽。

This is wrong:
這是錯(cuò)誤的:

BODY>
P>This is a paragraph/P>
/BODY>This is correct:
這是正確的:

body>
p>This is a paragraph/p>
/body>

--------------------------------------------------------------------------------

All XHTML Elements Must Be Closed
所有的XHTML元素必須關(guān)閉
Non-empty elements must have an end tag.
非空元素必須有關(guān)閉標(biāo)簽。

This is wrong:
這是錯(cuò)誤的:

p>This is a paragraph
p>This is another paragraphThis is correct:
正確是這樣:

p>This is a paragraph/p>
p>This is another paragraph/p>

--------------------------------------------------------------------------------

Empty Elements Must Also Be Closed
空的元素也必須關(guān)閉
Empty elements must either have an end tag or the start tag must end with />.
空的元素也必須有一個(gè)結(jié)束標(biāo)簽或者開(kāi)始標(biāo)簽用/>結(jié)束。

This is wrong:
這是錯(cuò)誤的:

This is a breakbr>
Here comes a horizontal rule:hr>
Here''''s an image img src="happy.gif" alt="Happy face">This is correct:
這是正確的:

This is a breakbr />

Here comes a horizontal rule:hr />Here''''s an image img src="happy.gif" alt="Happy face" />
IMPORTANT Compatibility Note:
注意兼容性的關(guān)鍵:
To make your XHTML compatible with today''''s browsers, you should add an extra space before the "/" symbol like this: br  />, and this: hr  />.
為了使你的XHTML能夠兼容現(xiàn)在的瀏覽器,你必須在/符號(hào)之前加一個(gè)特殊的空格,就像這樣:br  />和這樣:hr  />

標(biāo)簽:寧夏 衢州 陽(yáng)泉 鹽城 云南 晉中 來(lái)賓 北海

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《XHTML與HTML之間的區(qū)別》,本文關(guān)鍵詞  XHTML,與,HTML,之,間的,區(qū)別,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《XHTML與HTML之間的區(qū)別》相關(guān)的同類(lèi)信息!
  • 本頁(yè)收集關(guān)于XHTML與HTML之間的區(qū)別的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    德保县| 炎陵县| 全椒县| 玉门市| 嘉峪关市| 工布江达县| 武川县| 台北市| 托克逊县| 拜城县| 玉林市| 平定县| 新密市| 扎兰屯市| 象州县| 大同县| 宣城市| 梧州市| 衡南县| 恩平市| 镇巴县| 淳化县| 白银市| 虹口区| 奎屯市| 南郑县| 乐东| 浦县| 金坛市| 沈阳市| 澎湖县| 汝城县| 诸暨市| 长子县| 崇阳县| 长治市| 石狮市| 泉州市| 上虞市| 郴州市| 南宁市|