<article> 代表文件中「完整、獨立、可單獨發散」的內容單元。典型例子包括:部落格文章、新聞報導、論壇貼文、使用者評論、互動式 Widget。關鍵在於:若將此區塊剝離到其他情境(如 RSS 閱讀器、行動裝置 App、列印樣式),仍能獨立閱讀且不失語意。
<article class="film_review">
<header>
<h2>侏羅紀公園</h2>
</header>
<section class="main_review">
<p>Dinos were great!</p>
</section>
<section class="user_reviews">
<article class="user_review">
<p>Way too scary for me.</p>
<footer>
<p>Posted on <time datetime="2015-05-16 19:00">May 16</time> by Lisa.</p>
</footer>
</article>
<article class="user_review">
<p>I agree, dinos are my favorite.</p>
<footer>...</footer>
</article>
</section>
</article>
<article> 內部應有 <h1>-<h6> 作為主標題,構建文件大綱。<article>,巢狀於主文章內部。<article> 範疇,請分別使用 <aside>、<nav>、<header>/<footer>。| 元素 | 語義 | 典型用途 |
|---|---|---|
<article> | 獨立、可發散的完整內容 | 文章、貼文、評論、Widget |
<section> | 主題性群組,需有標題 | 章節、標籤頁、內容分區 |
<div> | 無語義,純排版容器 | CSS Hook、JS 掛載點、佈局包裝 |
<article> 包裹,內含標題、摘要、發布時間、閱讀更多連結。<article>,內含圖片、標題、價格、加入購物車按鈕。<time datetime> 標記發布/更新時間,利於機器解析。itemscope itemtype="https://schema.org/BlogPosting" 強化 SEO。正確使用 <article>,不僅符合 HTML5 語義化規範,更能為無障礙工具、搜尋引擎、內容聚合平台提供清晰的結構線索,是現代前端開發的基本功。