2014-09-20 91 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

相关问题