<greeting>Hello!</greeting>
我在规格中没有发现任何一种方式或其他:
http://dev.w3.org/html5/spec/single-page.html
所以如果有人可以帮助我一定回答这个,请做!
谢谢!
解决方法
Custom elements are new types of DOM elements that can be defined by
authors. Unlike 07002,which are stateless and ephemeral,custom
elements can encapsulate state and provide script interfaces.
自定义元素是一个更大的W3规范的一部分,称为Web Components,以及模板,HTML导入和阴影DOM。
Web Components enable Web application authors to define widgets with a
level of visual richness and interactivity not possible with CSS
alone,and ease of composition and reuse not possible with script
libraries today.
但是,从这个excellent walk through article在Google Developers关于自定义元素v1:
The name of a custom element must contain a dash (
-
). So<x-tags>
,<my-element>
,and<my-awesome-app>
are all valid names,while<tabs>
and<foo_bar>
are not. This requirement is so the HTML parser can distinguish custom elements from regular elements. It also ensures forward compatibility when new tags are added to HTML.
一些资源
> Web组件的“画廊”正在http://customelements.io/编译
> WebComponents.js充当Web组件的polyfill,直到它们被支持。参见WebComponents.js github page & web browser support table。