本文彙整 HTML 所有常用標籤、屬性、實體與 CSS 關鍵屬性,分類整理為文字、圖片、表格、表單、媒體、語意結構六大類,適合開發者快速查閱與初學者建立全貌。
<h1>-<h6>:六級標題,構成文件大綱。<p>:段落。<div>:通用區塊。<blockquote>:區塊引用,cite 屬性標註來源。<hr>:主題分隔線。<pre>:預先格式化 (保留空白換行)。<strong>, <em>, <mark>, <small>, <cite>, <code>, <kbd>, <samp>, <var>, <dfn>, <abbr>, <time>, <data>。<sub>, <sup>:下/上標。<ruby>, <rt>, <rp>:注音。<bdi>, <bdo>:雙向文字控制。<b>, <i>, <u>, <s>, <big> (移除), <tt> (移除), <font> (移除), <center> (移除), <strike> (移除), <blink> (非標準), <marquee> (非標準)。<br>:強制換行。<wbr>:建議斷行點。 ,  ,  ,  :各種空白實體。align="left|center|right|justify" → text-align。<center> → text-align:center 或 Flex/Grid 置中。<img src="" alt="">:alt 必填 (裝飾性圖用 alt=""),loading="lazy" 延遲載入,width/height 預留空間防 CLS。<picture> + <source type="image/webp" srcset="..."> + <img>:響應式、格式降級。<map name="mapname"> + <area shape="rect|circle|poly" coords="..." href="...">:影像地圖。<video controls preload="metadata" poster="..."> + <source src="" type="video/mp4"> + <track kind="subtitles" src="..." srclang="zh">。<audio controls> + <source>。<iframe src="" title="" sandbox="allow-scripts allow-same-origin">:沙箱安全屬性。<embed>, <object>, <param>:舊式外掛內容。<canvas>, <svg>:繪圖畫布。<table> + <caption> (標題) + <thead>/<tbody>/<tfoot> + <tr> + <th scope="col|row">/<td>。colspan, rowspan;複雜表頭用 headers 關聯多 th id。<colgroup>, <col span="2" style="width:20%">:欄群組樣式。<div style="overflow-x:auto"> 或 CSS 卡片重排。<form action="" method="POST" enctype="multipart/form-data">。<label for="id"> 綁定 <input id="id">。<input type="text|email|password|number|date|file|checkbox|radio|submit|button|hidden"> (20+ 類型)。required, pattern, min, max, step, maxlength, minlength。<textarea>, <select> + <option> + <optgroup>。<datalist id="list"> + <input list="list">:建議清單。<output>, <progress>, <meter>:結果/進度/測量。<button type="submit|reset|button">:優於 <input type="submit"> 可包含 HTML 內容。<header>, <footer>, <nav>, <main>, <article>, <section>, <aside>, <figure>, <figcaption>, <details>, <summary>, <dialog>, <address>。<script src="" defer>, <script type="module">, <noscript>。<template>:惰性 HTML 片段,JS content.cloneNode(true) 實例化。<slot>:Web Components 內容分發。| 字元 | 實體 | 十進位 | 用途 |
|---|---|---|---|
< | < | < | 標籤開啟 |
> | > | > | 標籤關閉 |
& | & | & | 實體起始 |
" | " | " | 屬性雙引號 |
| 空格 | |   | 不換行空格 |
| © | © | © | 版權 |
| ® | ® | ® | 註冊商標 |
收藏此速查表,開發時隨時查閱,提升編碼效率與品質。