【问题标题】:Why shouldn't I nest h4 element inside h3?为什么我不应该在 h3 中嵌套 h4 元素?
【发布时间】:2017-09-08 00:35:06
【问题描述】:

为什么不应该将 h4 元素嵌套在 h3 中?
为什么关注w3c-recommendation 很重要?

【问题讨论】:

    标签: html visual-studio warnings standards


    【解决方案1】:

    为什么我不应该在 h3 中嵌套 h4 元素?

    想想打印的文件:

    h2, h3, h4 {
    margin-bottom: 0;
    }
    
    h2 + p, h3 + p, h4 + p {
    margin-top: 0;
    }
    <h2>4. I am the main heading of a section</h2>
    <p>I am an introduction to the section and an overview of the main points that will be covered.</p>
    
    <h3>5.3 I am a sub-section heading</h3>
    <p>I am a sub-section. I cover points in detail.</p>
    
    <h4>6.1.2 I am a heading of a sub-section within the sub-section</h4>
    <p>I am a sub-section within a sub-section. I provide quite deep detail on a particular aspect of the topic under discussion.</p>

    现在考虑将 6.1.2 之类的子标题嵌套在 5.3 之类的子标题中。

    考虑将前者嵌套在后者中。

    你能想象一下吗?

    【讨论】:

      猜你喜欢
      • 2015-11-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-06
      • 1970-01-01
      • 1970-01-01
      • 2010-09-08
      • 2022-08-16
      相关资源
      最近更新 更多