html - 在 HTML5 中是否必须有 <section> 的标题

标签 html semantic-markup

标题是否有必要<section>在 HTML5 中,就像这里提到的一样 http://blog.whatwg.org/is-not-just-a-semantic

有时在一个页面上我们有一些相关的元素可以组合成一个 <section id="semantic name">相反 <div id="semantic name">但是我们没有任何标题..

可以用<section>吗没有 <h1> , <h2> , <h3>里面

最佳答案

According to the HTML5 Doctor , 你不应该使用 <section>如果没有自然航向。此外,他们说:

The section element represents a generic document or application section…The section element is not a generic container element. When an element is needed for styling purposes or as a convenience for scripting, authors are encouraged to use the div element instead.

此外,check out this nifty flowchart决定哪种元素最适合您的情况。

关于html - 在 HTML5 中是否必须有 <section> 的标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8544671/

相关文章:

html - 跨度的语义值

html - 我在博客主页的 <h1> 中放什么?

HTML - 带数字的有序列表的标记?

javascript - css滚动内容阴影效果

html - 背景图像大小保持其比例

javascript - 如果选择每日(复选框),请取消选择所有其他复选框

HTML5 : should hreflang always point to a direct translation?

html - <nav> 和 &lt;header&gt; 的关系

javascript - 如何快速找到绝对定位的子元素的相对定位的 HTML 父元素?

javascript - 尝试滚动时 jQueryUI AutoComplete 结果列表弹回顶部