You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

为何x-vendor-feature无法通过W3C校验?规范与校验器疑问

关于HTML自定义属性x-vendor-feature的校验问题

形如x-feature-vendor的标签属性现已纳入HTML规范:

针对HTML语法设计的标记级扩展功能,应限制为"x-vendor-feature"形式的新属性,其中vendor是标识扩展负责厂商的短字符串,feature为功能名称。

我尝试使用校验工具校验一段简单代码:

<!DOCTYPE html>
<head>
 <title>Test</title>
</head>
<body>
 <div class="Name" x-vendor-feature>
  <span id="FirstName"></span>
  <span id="SurName"></span>
 </div>
</body>

但校验器不允许使用x-vendor-feature属性,报错如下:

Error: Attribute x-vendor-feature not allowed on element div at this point.

是不是校验器还未更新?我希望开始使用x前缀的自定义属性。

内容的提问来源于stack exchange,提问作者Grove

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.15 03:44:50