Are Custom Attributes OK in XHTML
问题 I understand that according to the HTML specification, it's invalid to add custom attributes to elements. Is this also invalid with XHTML? 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 回答1: 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