微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

我在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)标记
>用div元素替换section元素。
>忽略警告。您看到的消息是非规范使用建议,根据HTML5 spec(突出我的):

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

原文地址:https://www.jb51.cc/html5/169422.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。