且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在XHTML中使用HTML5数据属性?

更新时间:2023-11-25 08:03:58

您可以使用 XHTML5 。然后你的标记将是XML,并且是有效的XHTML5。

You could use XHTML5. Then your mark-up would be XML, and valid XHTML5.

认为你也可以使用XML命名空间在XHTML1上使用它们 - 我我不太熟悉XML,所以我不确定。

I think you could also use XML namespacing to use them on XHTML1 — I’m not very familiar with XML, so I’m not sure.

我认为这两种方法技术上都要求你提供服务页面为XML(而不是 text / html ),Internet Explorer不支持。但我怀疑他们在浏览器中工作得很好,即使你没有。

I think that both of these methods technically require you to serve your pages as XML (instead of text/html), which Internet Explorer doesn’t support. But I suspect they’d work just fine in browsers even if you didn’t.