
HTML 的註解是由角括號 < 開始,然後一個驚嘆號 ! ,接著兩個連續的破折號 -- ,接著是註解內容,結尾則是兩個連續的破折號 -- ,最後角括號 > 結束,例如
<!-- comment -->
註解可以是多行的,例如
<!--
line 1
line 2
line 3
line 4
line 5
-->註解可以插在 HTML 文件中的任何地方,對於原本網頁內容不會有任何影響,例如
<!DOCTYPE html>
<html>
<head>
<title>HTML 5 DEMO</title>
<style>
article {
display: block;
}
</style>
</head>
<body>
<section>
<!-- 元素開始前的註解 -->
<article>
There is no spoon. <!-- 文字後的註解 -->
</article>
<article>
Ther<!-- 文字中的註解 -->e is no spoon.
</article> <!-- 元素結束後的註解 -->
</section>
</body>
</html>
<!-- 《程式語言教學誌》的範例程式
http://pydoing.blogspot.com/
檔名:commenttest.html
功能:示範 HTML 5 標記語言
作者:張凱慶
時間:西元 2011 年 12 月 -->瀏覽器 (broswer) 開啟如下

| 中英文術語對照 | |
|---|---|
| 註解 | comment |
| 瀏覽器 | broswer |
您可以繼續參考
基本概念
相關目錄
HTML 5 快速導覽
HTML, CSS 教材
首頁
參考資料
http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#comments
http://www.w3.org/TR/html5/syntax.html#comments
沒有留言:
張貼留言