中,请检查以下内容,一种变体是带有较少的标签,第二种是带有更多的标签。
我知道有些人说拥有更多标签会更好,有些人会说少一些,但是是否存在普遍接受的规则?
CONTACT US
Get in touch with the Foundation
with your
questions and queries
autocomplete="on" autofocus="on">
placeholder="email">
SEND MESSAGE
test@email.com
ADDRESS
name
2 road name
city
PHONE:
+12345678
要么
CONTACT US
Get in touch with the Foundation
with your
questions and queries
autocomplete="on" autofocus="on">
placeholder="email">
SEND MESSAGE
test@email.com
ADDRESS
name
2 road name
city
PHONE:
+12345678
我建议您学习HTML5规范。
@ba?megakapa HTML5规范非常繁琐,我认为在这里实际提供一些建议是值得的
尝试使用HTML5 Outliner来查看这两个标记之间的区别。
@jacques我猜这不是正确的地方。 太久了
每当(*)使用标题(h1-h6)时,也可以使用section(**)包装该标题及其内容。 您可以在我对一个特殊问题的回答中阅读更多有关此的内容。
可以,不是必须的。
HTML5(CR)规范说:
Authors are also encouraged to explicitly wrap sections in elements of sectioning content, instead of relying on the implicit sections generated by having multiple headings in one element of sectioning content.
鼓励您,这是您的问题。
(*网站标题除外,即该标题是body的子元素,并且没有其他sectioning内容元素。)
(**除非内容适用于article,aside或nav。)
I read that any related content should be wrapped in
[…]
这不是真的。"相关"可能意味着很多事情。 遵循规范中的定义。 请注意,section(以及其他节元素article,aside和nav)在生成文档大纲中起作用。