2014-09-20 92 views
1

我是新來的HTML5標記。可以在HTML5的頁腳標籤中使用章節標籤嗎?

我想知道是否允許我在下面的頁腳內有段標籤。

<article> 
    <header class="content__header"> 
    </header> 

    <section class="content__body"> 
    </section> 

    <footer class="content__footer> 
     <section class="relatedArticles"> 
     </section> 
     <section class="pagination"> 
     </section> 
    </footer> 

</article> 

w3c文檔沒有解釋太多關於頁腳標籤的用法。

謝謝!

+1

簡單地說,是的。完全有效的HTML5。 – worldofjr 2014-09-20 04:08:15

+1

根據[rfc](http://www.w3.org/TR/html5/sections.html#the-section-element)部分有效凡[流量內容](http://www.w3.org/ TR/html5/dom.html#flow-content-1)。所以它是完全有效的。 – bansi 2014-09-20 04:11:18

+1

「w3c文檔沒有解釋太多關於頁腳標籤的用法。」你確定?我在這裏看到很多例子(http://www.w3.org/TR/html5/sections.html#the-footer-element)。 – BoltClock 2014-09-20 04:11:35

回答

7

w3c文檔沒有解釋太多關於頁腳標籤的用法。

......實際上,它的確如此。第4.3.8節<footer>http://www.w3.org/TR/html5/sections.html#the-footer-element)規定:

內容模型:Flow content,但沒有頁眉,頁腳或主元件後代。

The section of the specifiction defining "Flow content" (3.2.4.1.2) lists all "flow" elements,其中列出了<section>

因此,因此,你的HTML是有效的:<section>可以是<footer>的後裔,但是<header><footer>,並且<main>不能。

+0

非常感謝! – W3Q 2014-09-20 04:16:04

相關問題