w3c html验证错误 - 部分缺少标题。考虑使用h2-h6元素为所有部分添加标识标题 [英] w3c html validation error - Section lacks heading. Consider using h2-h6 elements to add identifying headings to all sections

查看:637
本文介绍了w3c html验证错误 - 部分缺少标题。考虑使用h2-h6元素为所有部分添加标识标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am getting a warning when I try to validate my page in http://validator.w3.org :


部分缺少标题。考虑使用h2-h6元素为所有部分添加标识标题。

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

我的代码如下:

My code is as below :

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

如何删除此错误?我是否强制需要在章节标题内添加 h1 - h6 标签?

How can I remove this error ? Do I compulsory need to add h1-h6 tags inside section heading ?

推荐答案

要么:


  1. 添加标题( h1 ,..., h6 )标记到部分元素。

  2. div 元素替换部分元素。

  3. 忽略警告。根据非规范性使用建议.html #the-section-element> HTML5规范(突出我的):
  1. Add a heading (h1, ..., h6) tag to your section element.
  2. Replace your section element with a div element.
  3. Ignore the warning. The message you're seeing is a non-normative usage recommendation, as per the HTML5 spec (highlighting mine):

每个<$ c的主题通常由
包括一个标题( h1 - <$ c)来标识$ c> section 作为部分
元素的子元素

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

的子元素<$ c> h6

这篇关于w3c html验证错误 - 部分缺少标题。考虑使用h2-h6元素为所有部分添加标识标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆