简体   繁体   English

w3c标记验证:目前,元素li上的属性持续时间不允许

[英]w3c markup validation: Attribute duration not allowed on element li at this point

I'm getting this error when I validate through w3c validator: 通过w3c验证程序验证时出现此错误:

Attribute duration not allowed on element li at this point. 此时,元素li上的属性持续时间不允许。

<li data-text-id="#bannerscollection_kenburns_photoText3" data-horizontalPosition="center" data-verticalPosition="center" data-initialZoom="1" data-finalZoom="1" duration="5" >

Somebody please help me. 有人请帮助我。 Thanks in advance 提前致谢

试试这个代码:

<li data-text-id="#bannerscollection_kenburns_photoText3" data-horizontalPosition="center" data-verticalPosition="center" data-initialZoom="1" data-finalZoom="1" data-duration="5" >

As the message says, the attribute duration is not allowed for the element li , as you can easily check in the specification : 如消息所示,元素li不允许属性duration ,因为您可以轻松地检查规格

Content attributes: 内容属性:

  • Global attributes 全局属性
  • If the element is a child of an ol element: value 如果元素是ol元素的子元素: value

duration is not a global attribute . duration 不是 全局属性

You could prefix it with data- , as you do it with all the other attributes, too. 您也可以为它加上data-前缀,也可以为所有其他属性添加前缀。 But then, if you use a third-party tool that needs a duration attribute, it would not work anymore. 但是, 如果您使用需要duration属性的第三方工具,它将不再起作用。 (You didn't say anything about a tool in your question, though.) (不过,您没有在问题中说出关于工具的任何内容。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM