article
HTML Spec: “The article element represents a self-contained composition in a document, page, application, or site and that is, in principle, independently distributable or reusable, e.g. in syndication.”
article 是一個(gè)特殊的 section 標(biāo)簽,它比 section 具有更明確的語義, 它代表一個(gè)獨(dú)立的、完整的相關(guān)內(nèi)容塊。一般來說, article 會(huì)有標(biāo)題部分(通常包含在 header 內(nèi)),有時(shí)也會(huì) 包含 footer 。雖然 section 也是帶有主題性的一塊內(nèi)容,但是無論從結(jié)構(gòu)上還是內(nèi)容上來說,article 本身就是獨(dú)立的、完整的。
HTML Spec 中接著又列舉了一些 article 適用的場景。 “This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content.”
當(dāng) article 內(nèi)嵌 article 時(shí),原則上來說,內(nèi)部的 article 的內(nèi)容是和外層的 article 內(nèi)容是相關(guān)的。例如,一篇博客文章中,包含用戶提交的評(píng)論的 article 就應(yīng)該潛逃在包含博客文章 article 之中。
問題是怎么才算“完整的獨(dú)立內(nèi)容”?有個(gè)最簡單的判斷方法是看這段內(nèi)容在 RSS feed 中是不是完整的?催@段內(nèi)容脫離了所在的語境,是否還是完整的、獨(dú)立的。
例子:
<article> <header> <h1>The Very First Rule of Life</h1> <p><time pubdate datetime="2009-10-09T14:28-08:00"></time></p> </header> <p>If there's a microphone anywhere near you, assume it's hot and sending whatever you're saying to the world. Seriously.</p> <p>...</p> <footer> <a href="?comments=1">Show comments...</a> </footer> </article><article> <header> <h1>The Very First Rule of Life</h1> <p><time pubdate datetime="2009-10-09T14:28-08:00"></time></p> </header> <p>If there's a microphone anywhere near you, assume it's hot and sending whatever you're saying to the world. Seriously.</p> <p>...</p> <section> <h1>Comments</h1> <article> <footer> <p>Posted by: George Washington</p> <p><time pubdate datetime="2009-10-10T19:10-08:00"></time></p> </footer> <p>Yeah! Especially when talking about your lobbyist friends!</p> </article> <article> <footer> <p>Posted by: George Hammond</p> <p><time pubdate datetime="2009-10-10T19:15-08:00"></time></p> </footer> <p>Hey, you have the same first name as me.</p> </article> </section> </article>
出處:前端觀察
責(zé)任編輯:moby
上一頁 div section article 的區(qū)別 [1] 下一頁 div section article 的區(qū)別 [3]
◎進(jìn)入論壇網(wǎng)頁制作、WEB標(biāo)準(zhǔn)化版塊參加討論,我還想發(fā)表評(píng)論。
|