HTML 標籤是構建網頁的最小單位,也是 HTML 語言最重要的組成部分。本文釐清定義、大小寫規則與核心地位。
<body>...</body>
<BODY>...</BODY>
<Body>...</Body>
| 分類 | 範例 | 說明 |
|---|---|---|
| 文件結構 | html, head, body, title, meta, link, style, script | 定義文件架構與資源 |
| 文字語意 | h1-h6, p, strong, em, blockquote, cite, code | 賦予內容語意 |
| 佈局分組 | div, span, header, footer, main, section, article, aside, nav | HTML5 新增語意區塊 |
| 列表 | ul, ol, li, dl, dt, dd | 有序/無序/定義列表 |
| 表格 | table, thead, tbody, tfoot, tr, th, td, caption | 結構化資料 |
| 表單 | form, input, textarea, select, button, label, fieldset | 使用者輸入介面 |
| 多媒體 | img, audio, video, picture, source, canvas, svg | 嵌入媒體內容 |
| 互動/腳本 | a, button, details, summary, dialog, script, noscript | 行為與動態功能 |
br, hr, img, input, meta, link)<div><p>...</p></div>(正確),<div><p>...</div></p>(錯誤)class="box"