2014-10-03 98 views
0

據我瞭解,良好的HTML5實踐是使用H2-H6標籤來命名各部分:命名一個HTML5 <section>內聯<span>,而不是塊級元素

<section id='chapter_one' class='chapter'> 
    <h3>Chapter One</h3> 
    <p>My site has lots of content.</p> 
</section> 

沒有元素W3C驗證給「部分缺乏標題,考慮使用h2-h6元素爲所有部分添加標識標題「。這很好,但是有沒有辦法使用內聯元素而不是段標籤的塊元素?

<section id='chapter_one' class='chapter'> 
    <p>Welcome to <span>Chapter One</span> of my fine content rich site.</p> 
</section> 

參考文獻:http://www.smashingmagazine.com/2013/01/18/the-importance-of-sections/w3c html validation error - Section lacks heading. Consider using h2-h6 elements to add identifying headings to all sectionsIs it necessary to have a heading of <section> in HTML5

回答

0

作爲HTML5規範定義了在Headings and sections

標題內容的在切片內容的一個元素的第一元素代表該部分的標題。

而且heading content類別包含:

h1h2h3h4h5h6

+0

如何ARIA-labelledby = 「章_ {{ID}}」 Bryce 2014-10-03 20:04:41

+0

@Bryce:WAI-ARIA不會影響文檔大綱。 (它可以幫助輔助技術,但不一定會被其他HTML用戶使用。) – unor 2014-10-03 20:12:57

相關問題