<section><h1>H1 tag in a section tag</h1></section> <article><h1>H1 tag in an article tag</h1></article> <h1>H1 tag in nothing</h1>
复制粘贴到here.(只是把它放在方便)
解决方法
section
:
@H_502_10@
The section element represents a generic document or application
section…The section element is not a generic container element. When
an element is needed for styling purposes or as a convenience for
scripting,authors are encouraged to use the div element instead.
Helpful rules of thumb from Html5doctor:
>不要使用它作为样式或脚本的钩子;这是一个div
>如果文章,旁边或导航更合适,不要使用它
>不要使用它,除非在本节开始时自然有一个标题
>使用文章代替联合内容
The article element represents a component of a page that consists of
a self-contained composition in a document,page,application,or site
and that is intended to be independently distributable or reusable,
e.g. in syndication. This could be a forum post,a magazine or
newspaper article,a blog entry,a user-submitted comment,an
interactive widget or gadget,or any other independent item of content
当没有其他元素可以在语义上更好地描述它时使用div,或者您需要一个语义上无意义的钩子来进行样式化.
h1s看起来不一样的原因是因为各个浏览器使它们不同.您可以在浏览器之间规范化事物,并处理带有css reset的默认浏览器样式表.