HTML标签名自定义,HTML 5自定义元素名称?

In HTML 5 specification the parser and the specification state that

the element name can be everything starting with a letter and followed

by alpha-numeric characters.

不正确.规范声明元素名称必须是该文档中明确列出的名称之一,或者在另一个适用的规范中.这些包括但不限于SVG和MathML.

该规范还包括HTML的消费者的处理规范,例如浏览器.这并没有描述什么是“允许”,它描述了这些消费者应该对文档的每个字符做什么,无论它是否包含允许或不允许的内容.

Now the question is what happens if I introduce additional elements

not part of the specification but valid in terms of compliance to the

specified syntax.

遵循以上规则. “指定语法”无关紧要.规范描述了消费者应该对任何输入字符串做什么.

What do all those browsers do when they encounter elements with custom

yet unknown name? Does those elements got treated like any element or

are they left out, stripped out or replaced?

它们被视为http://www.w3.org/1999/xhtml名称空间中实现HTMLUnknownElement接口的元素.

How for instance do HTML5 editor behave?

如果它们符合HTML5,则在读取HTML时它们的行为方式相同.

Is there anything in the specifications I have overlooked regarding

valid element tag names?

见上面的第一段.此外,Custom Elements spec使任何元素名称以ASCII字母开头并包含连字符被认为是有效的.目前还不清楚该规范目前是否是“HTML5适用规范”,但如果不是,它很可能很快就会出现.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值