我一直无法找到自定义标签在HTML5中是否有效的明确答案,如下所示:
<greeting>Hello!</greeting>
Run Code Online (Sandbox Code Playgroud)
我没有在规范中找到任何方式:
http://dev.w3.org/html5/spec/single-page.html
并且自定义标签似乎不会使用W3C验证器进行验证.
在我的HTML中,我很好奇是否在语义上正确使用唯一标识符,例如<toys> </toys>保存图像而不是图像<h2>.例如:
是否首选:
<toys class="grid_4 push_2"> </toys>
与CSS:
toys {
background: url("toys.png") no-repeat scroll 0 0 transparent;
width: 181px;
height: 93px;
margin-top: -8px;
}
Run Code Online (Sandbox Code Playgroud)
而不是:我目前有:
<h1 class="grid_4 push_2"> </h1>
与CSS:
h1 {
background: url("toys.png") no-repeat scroll 0 0 transparent;
width: 181px;
height: 93px;
margin-top: -8px;
}
Run Code Online (Sandbox Code Playgroud)
是否使用像<toys>语义正确的唯一标识符?