豐富多彩的網頁皆由五大核心要素構成。理解各要素特性與最佳實務,是前端開發的基石。
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif),中文 16px (1rem) 起跳,行高 1.5-1.75。h1-h6, p, strong, em, blockquote, cite, code, mark, time。srcset/sizes/<picture>)、延遲載入 (loading="lazy")、CDN 分發。alt 屬性(裝飾性圖用 alt="")。mailto:)、電話 (tel:)、檔案下載、程式啟動。href (目標)、target (_blank 需配合 rel="noopener noreferrer")、rel (nofollow, sponsored, ugc)、download (強制下載)。table > thead > tr > th, tbody > tr > td, tfoot, caption, colgroup。scope, headers, caption 三大支柱。overflow-x: auto 或轉卡片式。form, input (type 多樣), textarea, select, button, label, fieldset, legend, datalist, output。required, pattern, min/max, type 語意驗證。label for=id 關聯、aria-describedby 錯誤訊息、autocomplete 正確設定。GET (查詢/冪等), POST (異動/非冪等), enctype (檔案上傳用 multipart/form-data)。<frameset>/<frame> 已從 HTML5 移除,破壞可用性/SEO/書籤/列印。<iframe> (嵌入第三方內容)、SPA 路由、Web Components、Server-Side Includes (SSI)、模板引擎部分渲染。