这个属性“headerindex=”5h”是什么?

发布于 2024-08-24 08:45:23 字数 212 浏览 5 评论 0原文

我在一个基于 CMS(sitecore) 的基于 Asp.net 2.0 Webform 的网站上看到了这个。

<a class="boardTextLink " id="boardTextLink6" headerindex="5h">

它在语义上正确并且 w3c 有效吗?我们可以创建和使用这样的自定义属性吗?这是好的做法吗?

I saw this on a CMS(sitecore) based Asp.net 2.0 Webform based site.

<a class="boardTextLink " id="boardTextLink6" headerindex="5h">

is it semantically correct and w3c valid? Can we make and use custom attributes like this? Is it good practice?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

后eg是否自 2024-08-31 08:45:23

它是一个私有的虚构属性,可能放置在那里供某些 javascript 检查/使用

its a private made-up attribute probably placed there to be examined/used by some javascript

拒绝两难 2024-08-31 08:45:23

不,这是不正确的,也不是一个好的做法。这种标记将无法验证

此参数用于 dojo 工具包,JavaScript 框架大量使用自定义属性用于进行一些自动替换来创建小部件。

有关自定义属性 VS 类的更多信息,请阅读此处

我认为将其用于私人网站(CMS 管理界面封闭的网站内联网)是可以的,但您应该避免在公共网站上使用它。

no it's not correct and not a good practice. This kind of markup would fail to validate

This argument was used against dojo toolkit, the JavaScript framework heavily use custom attributes for doing some automatic replacement to create widget.

more reading about the custom attribute VS class here.

I think it's kind of okay to use that for private website (CMS admin interface closed website intranet) but you should avoid it on public websites.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文