Xhtml 元素是以 XML 格式編寫的 HTML 元素。
XHTML 元素必須正確嵌套
XHTML 元素必須始終關(guān)閉
XHTML 元素必須小寫
XHTML 文檔必須有一個(gè)根元素
在 HTML 中,某些元素可以不正確地彼此嵌套在一起,就像這樣:
<b><i>This text is bold and italic</b></i>
在 XHTML 中,所有元素必須正確地彼此嵌套,就像這樣:
<b><i>This text is bold and italic</i></b>
這是錯(cuò)誤的:
<p>This is a paragraph<p>This is another paragraph
這是正確的:
<p>This is a paragraph</p><p>This is another paragraph</p>
這是錯(cuò)誤的:
A break: <br>A horizontal rule: <hr>An image: <img src="happy.gif" alt="Happy face">
這是正確的:
A break: <br />A horizontal rule: <hr />An image: <img src="happy.gif" alt="Happy face" />
這是錯(cuò)誤的:
<BODY><P>This is a paragraph</P></BODY>
這是正確的:
<body><p>This is a paragraph</p></body>
新聞熱點(diǎn)
疑難解答