过度使用html节元素

时间:2014-02-08 23:43:55

标签: html html5

试图找出html5 <section>元素的正确用法。我是否过度使用了此实例中的<section>元素?

<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 个答案:

答案 0 :(得分:1)

MDN 有一个使用相同方式的示例,因此看起来您正确使用它。只要这些都是您网站的大纲,那么在语义上使用部分而不是 div

是有意义的

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

相关问题