2014-02-08 33 views
0

試圖找出正確使用html5 <section>元素的方法。在這種情況下,我是否過度使用<section>元素?過度使用html部分元素

<main> 
    <section id="slider"> 
     <h2>What we can do</h2><!-- not visible --> 
     <section> 
      <h3>Slider 1</h3> 
      <p>description</p> 
     </section> 
     <section> 
      <h3>Slider 2</h3> 
      <p>description</p> 
     </section> 
     <section> 
      <h3>Slider 3</h3> 
      <p>description</p> 
     </section> 
    </section> 

    <section> 
     <h2>Our mission</h2><!-- not visible --> 
     <section> 
      <h3>Grow</h3> 
      <p>description</p> 
     </section> 
     <section> 
      <h3>Big Ideas</h3> 
      <p>description</p> 
     </section> 
     <section> 
      <h3>Latest Trends</h3> 
      <p>description</p> 
     </section> 
    </section> 
</main> 

回答

1

MDN有使用同樣的方式,所以它看起來像你使用了正確的一個例子。只要那些是你的網站的所有輪廓,然後在語義上是有意義的使用部分

https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Sections_and_Outlines_of_an_HTML5_document?redirectlocale=en-US&redirectslug=Web%2FHTML%2FSections_and_Outlines_of_an_HTML5_document#The_HTML5_Outline_Algorithm

+0

[令人印象深刻的站點(http://www.impressivewebs.com/html5-部分/)狀態「DO使用標籤切換器或**內容滑塊**(如果不需要無序列表)的每個單獨部分的使用部分」 – Larry21

+1

@ Larry21你有什麼不適合div的好地方。部分肯定會是更好的選擇。這些不是通用元素,它們是內容片段。 div現在僅用於佈局中對內容文檔沒有意義的地方。 – m59

+0

@ Larry21我相信Mozilla開發者網絡會比Louis Lazaris更有信心,尤其是因爲Lazaris先生似乎無法在自己的博客文章中下定決心。 –