XHTML中的自定义属性是否正确 [英] Are Custom Attributes OK in XHTML

查看:71
本文介绍了XHTML中的自定义属性是否正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解,根据HTML规范,向元素添加自定义属性是无效的。

I understand that according to the HTML specification, it's invalid to add custom attributes to elements. Is this also invalid with XHTML?

我认为XHTML是XML家族的一部分,因此是可扩展的。可扩展性是不是可以使用自定义属性?

I thought XHTML was part of the XML family, and as such was extensible. Being extensible, isn't it ok to use custom attributes?

Dave

推荐答案

自定义属性不会被标准的W3C验证器视为有效。
不过,您可以定义自己的文档类型定义(DTD)。有关更多信息,请参见 http://www.alistapart.com/articles/customdtd/

custom attributes won't be considered valid by the standard W3C validators. You can define your own document type definition (DTD) though. See http://www.alistapart.com/articles/customdtd/ for more information about that.

这篇关于XHTML中的自定义属性是否正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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