HTML语义:div节文章,还是div节文章?顺序重要吗?
HTML Semantics: div section article, or section div article? Does order matter?
我有一种利用部分的方式,我想知道出于语义 SEO 原因的正确使用/最佳实践。 更好,为什么,有没有更好的方法?
最好使用 THEN a div 部分,反之亦然,还是真的一样?
<section role="title" class="title">
<div>
<article>
<h1>Page Title</h1>
</article>
</div>
</section>
对比:
<div role="title" class="title">
<section>
<article>
<h1>Page Title</h1>
</article>
</section>
</div>
我使用 Foundation 6 框架并使用语义 SASS 来处理我的行、列等。
section[role="title"], section.title {
padding: 100px 0;
background: black;
div {
@include flex-grid-row(); // max-width: 1200px;
article {
@include flex-grid-column(12); // width: 100%; or 12 out of 12 columns
h1 {
color: white;
}
}
}
}
希望你们中的一些人能明白我为什么要问这个。我的典型布局是 div, section, article / aside。看看它是否重要。
我有一种利用部分的方式,我想知道出于语义 SEO 原因的正确使用/最佳实践。 更好,为什么,有没有更好的方法?
最好使用 THEN a div 部分,反之亦然,还是真的一样?
<section role="title" class="title">
<div>
<article>
<h1>Page Title</h1>
</article>
</div>
</section>
对比:
<div role="title" class="title">
<section>
<article>
<h1>Page Title</h1>
</article>
</section>
</div>
我使用 Foundation 6 框架并使用语义 SASS 来处理我的行、列等。
section[role="title"], section.title {
padding: 100px 0;
background: black;
div {
@include flex-grid-row(); // max-width: 1200px;
article {
@include flex-grid-column(12); // width: 100%; or 12 out of 12 columns
h1 {
color: white;
}
}
}
}
希望你们中的一些人能明白我为什么要问这个。我的典型布局是 div, section, article / aside。看看它是否重要。