开发者

How many tags can have same id in document

I know there can be only one unique ID attribute per document. To be sure, I need real doc link where t开发者_Python百科his is written.


From http://www.w3.org/TR/html40/struct/global.html#adef-id:

This attribute assigns a name to an element. This name must be unique in a document.


http://www.w3.org/TR/html401/struct/global.html#adef-id


You can repeat a unique ID exactly seven times before the W3 will knock on your door. It's kind of like the bloody mary thing in the bathroom mirror except way geekier.


You can use the id attribute as many times in an XHTML document as you like, but you shouldn't be using the same id multiple times - that's what classes are for.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜