gpt4 book ai didi

html - w3c html 验证错误 - 部分缺少标题。考虑使用 h2-h6 元素为所有部分添加标识标题

转载 作者:技术小花猫 更新时间:2023-10-29 11:40:29 24 4
gpt4 key购买 nike

当我尝试在 http://validator.w3.org 中验证我的页面时收到警告:

Section lacks heading. Consider using h2-h6 elements to add identifying headings to all sections.

我的代码如下:

<section id="slider-wrapper-new">
<div class="slider-container-new">
// some code..
</div>
</section>

如何消除这个错误?我是否必须在节标题内添加 h1-h6 标签?

最佳答案

或者:

<醇>
  • 将标题(h1, ..., h6)标签添加到您的 section 元素。
  • section 元素替换为 div 元素。
  • 忽略警告。根据 HTML5 spec,您看到的消息是非规范使用建议(突出显示我的):

    The theme of each section should be identified, typically by including a heading (h1-h6 element) as a child of the section element.

  • 关于html - w3c html 验证错误 - 部分缺少标题。考虑使用 h2-h6 元素为所有部分添加标识标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24155024/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com