HTML 標籤超過 100 種,屬性更多。聰明學習法不是背誦清單,而是建立高頻核心語法肌肉記憶,並善用瀏覽器開發者工具反向推導。
document.body.innerHTML = '...' 實驗結構<!-- 圖片:alt 必填 (SEO/無障礙)、loading=lazy 效能 -->
<img src="image.webp" alt="描述" loading="lazy" width="800" height="450">
<!-- 連結:rel=nofollow/noopener/noreferrer 安全 -->
<a href="https://example.com" target="_blank" rel="noopener noreferrer">連結文字</a>
<!-- SEO 三大 Meta -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="頁面描述 150 字內">
<meta property="og:title" content="社群分享標題">
<meta property="og:image" content="https://example.com/og.jpg">
<!-- 語意結構 -->
<header><nav><ul><li><a>...</a></li></ul></nav></header>
<main><article><h1>...</h1><p>...</p></article></main>
<footer>...</footer>
<!-- 表單基礎 -->
<form>
<label>Email <input type="email" name="email" required></label>
<button type="submit">送出</button>
</form>
<div> 包一切 → ✅ 先思考「這內容是什麼語意?」選擇對應標籤style="" → ✅ 類名 + CSS 檔案,關注點分離alt、label、scope → ✅ 無障礙是基本功,不是加分項