文檔結構標籤
| 標籤 | 用途 |
<html> | 根元素 |
<head> | 元數據容器 |
<title> | 文檔標題 |
<body> | 可見內容區 |
<header> | 頁首/區塊頭 |
<footer> | 頁腳/區塊尾 |
<nav> | 導航鏈接群 |
<main> | 主內容區(唯一) |
<article> | 獨立完整內容 |
<section> | 主題性區塊 |
<aside> | 側邊欄/附註 |
文本語義標籤
| 標籤 | 語義 | 默認樣式 |
<h1>-<h6> | 標題層級 | 粗體、字號遞減 |
<p> | 段落 | 上下邊距 |
<strong> | 重要/嚴肅 | 粗體 |
<em> | 強調 | 斜體 |
<mark> | 高亮/標記 | 黃背景 |
<small> | 側註/小字 | 小字號 |
<del> | 刪除內容 | 刪除線 |
<ins> | 插入內容 | 下劃線 |
<code> | 行內代碼 | 等寬字體 |
<pre> | 預格式化塊 | 保留空白換行 |
<blockquote> | 塊級引用 | 縮進 |
<q> | 行內引用 | 自動加引號 |
<cite> | 作品標題 | 斜體 |
<abbr> | 縮寫 | 底部虛線+title提示 |
<time> | 時間日期 | 無特殊樣式 |
<sup>/<sub> | 上/下標 | 字號縮小上移/下移 |
列表標籤
<ul> + <li>:無序列表
<ol> + <li>:有序列表(type, start, reversed)
<dl> + <dt>(術語) + <dd>(描述):描述列表
表單標籤
| 標籤 | 用途 | 關鍵屬性 |
<form> | 表單容器 | action, method, enctype |
<input> | 輸入控件 | type(text/password/email/number/date/checkbox/radio/file/hidden…), name, value, required, placeholder |
<textarea> | 多行文本 | rows, cols, maxlength |
<select> + <option> | 下拉選單 | multiple, size |
<button> | 按鈕 | type(submit/reset/button) |
<label> | 標籤綁定 | for=input_id |
<fieldset>/<legend> | 分組/標題 | — |
<datalist> | 輸入建議 | 配合 input list 屬性 |
<output> | 計算結果 | for=關聯input_id |
媒體與嵌入
<img>:圖片(src, alt, width, height, loading=lazy)
<picture> + <source>:響應式圖片
<video>/<audio>:媒體播放(controls, autoplay, loop, preload)
<iframe>:嵌套瀏覽上下文
<canvas>:位圖繪圖
<svg>:矢量圖形
表格標籤
<table>, <caption>, <thead>, <tbody>, <tfoot>, <tr>, <th>, <td>, <colgroup>, <col>。屬性:colspan, rowspan, headers。
已棄用/不推薦標籤(了解即可)
<font>, <center>, <strike>, <u>, <big>, <tt>, <frame>, <frameset>, <marquee>, <blink> — 請用 CSS 替代。