| 標籤 | 語意 | 典型用途 | 隱含 ARIA Role |
|---|---|---|---|
<header> | 頁面/區塊頭部 | Logo、導航、標題、搜尋 | banner (頁面級) |
<nav> | 主要導航群組 | 主選單、麵包屑、分頁 | navigation |
<main> | 文件主要內容 (唯一) | 文章主體、應用核心視圖 | main |
<article> | 獨立可發布內容 | 部落格文、新聞、商品卡、論壇貼文 | article |
<section> | 主題性內容群組 | 章節、標籤頁面板、FAQ 區塊 | region (需 aria-label) |
<aside> | 側邊/輔助內容 | 側邊欄、廣告、相關連結、定義 | complementary |
<footer> | 頁面/區塊底部 | 版權、聯絡、站點地圖、作者資訊 | contentinfo (頁面級) |
<figure> | 獨立內容單元 (含標題) | 圖表、程式碼、照片、影片 | figure |
<figcaption> | figure 標題/說明 | 圖片說明、程式碼標題 | - |
<details> | 可摺疊詳情容器 | FAQ、側欄展開、進階設定 | group |
<summary> | details 摘要/標題 | 點擊展開/摺疊觸發器 | button |
<dialog> | 對話框/模態框 | 彈窗、檢視器、側邊欄抽屜 | dialog |
<mark> | 高亮/標記文字 | 搜尋關鍵字高亮、重點標記 | - |
<time> | 機器可讀日期/時間 | 文章發布時間、活動日期 | - |
<data> | 機器可讀資料 | 產品 ID、價格數值 | - |
| 標籤/屬性 | 功能 | 瀏覽器支援 |
|---|---|---|
<input type="email"> | 郵件格式驗證 | 全支援 |
<input type="url"> | 網址格式驗證 | 全支援 |
<input type="tel"> | 電話號碼 (無強制格式) | 全支援 |
<input type="search"> | 搜尋框 (含清除按鈕) | 全支援 |
<input type="number"> | 數字輸入 (含步進器) | 全支援 |
<input type="range"> | 滑桿選擇數值 | 全支援 |
<input type="date"> | 日期選擇器 | 全支援 (Safari 較晚) |
<input type="time"> | 時間選擇器 | 全支援 |
<input type="datetime-local"> | 本地日期時間 | 全支援 |
<input type="month"> | 年月選擇 | 全支援 |
<input type="week"> | 年週選擇 | 部分支援 |
<input type="color"> | 顏色選擇器 | 全支援 |
<datalist> | 輸入建議清單 | 全支援 |
<output> | 計算結果顯示 | 全支援 |
<progress> | 任務進度條 | 全支援 |
<meter> | 標量測量儀 | 全支援 |
placeholder | 佔位提示文字 | 全支援 |
autofocus | 自動聚焦 | 全支援 |
required | 必填驗證 | 全支援 |
pattern | 正則表達式驗證 | 全支援 |
min/max/step | 數值/日期範圍限制 | 全支援 |
multiple | 多檔/多值選擇 | 全支援 |
form | 關聯非巢狀 form | 全支援 |
novalidate (form) | 停用瀏覽器原生驗證 | 全支援 |
| 標籤 | 功能 | 關鍵 API/屬性 |
|---|---|---|
<video> | 影片播放 | src, controls, poster, preload, playsinline, crossorigin, mediagroup |
<audio> | 音訊播放 | src, controls, preload, loop, muted |
<source> | 多格式備援 | src, type, media |
<track> | 字幕/章節/描述 | kind (subtitles, captions, descriptions, chapters, metadata), srclang, label |
<canvas> | 2D/3D 繪圖 | getContext('2d'), getContext('webgl'), width, height |
<svg> | 向量圖形 (XML) | 內嵌 SVG DOM 可操作 |
<picture> | 響應式圖片 | <source media="" srcset="" type=""> + <img> |
<img> 新屬性 | 響應式/延遲載入 | srcset, sizes, loading="lazy/eager", decoding="async/sync", fetchpriority |
| 標籤 | 功能 | 狀態/備註 |
|---|---|---|
<template> | HTML 模板內容 (惰性載入) | 標準,配合 JS cloneNode 使用 |
<slot> | Shadow DOM 插槽 | Web Components 核心 |
<custom-element> | 自訂元素 | customElements.define() 註冊 |
<details> | 原生摺疊 | 無需 JS,open 屬性控制 |
<dialog> | 原生模態框 | showModal(), close(), ::backdrop 樣式 |
<command> | 命令按鈕 | 已棄用,改用 <button> + JS |
<menu> | 選單/工具列 | 重新定義為工具列語意,<ul> 仍用於清單 |
| 標籤 | 替代方案 |
|---|---|
<acronym> | <abbr> |
<applet> | <object> / <embed> / 現代框架 |
<basefont> | CSS font |
<big> | CSS font-size: larger |
<center> | CSS text-align: center / Flexbox |
<dir> | <ul> |
<font> | CSS font-family, color, font-size |
<frame>, <frameset>, <noframes> | <iframe> / CSS Grid/Flex 排版 |
<strike> | <del> (刪除) / <s> (不準確) |
<tt> | <code>, <kbd>, <samp>, CSS font-family: monospace |
<isindex> | <form> + <input type="search"> |
<listing>, <xmp>, <plaintext> | <pre><code> |
<marquee>, <blink> | CSS Animation / @keyframes |
<rb>, <rtc> | Ruby 標記簡化,用 <ruby><rt> |
<keygen> | Web Crypto API |
<menuitem> | <button> + JS / Context Menu API |
contenteditable:元素可編輯draggable:可拖曳dropzone:放置區 (已棄用,改用 DropZone API)hidden:隱藏 (布林屬性)spellcheck:拼字檢查translate:是否翻譯data-*:自訂資料屬性aria-*, role:無障礙屬性slot, part:Web Componentsinert:非互動/不可聚焦 (新)popover:彈出式內容 (新)