这是否正确使用< section>标签?
<section id="container"> <section id="outer"> <section id="inner"> </section> </section> </section>
我试图找出我是否只应该使用一个部分ID,并将其他两个部分作为只是div?
解决方法
如果您只是使用这些元素来放置某些位置/风格的东西,那么您应该使用div。
部分是真正的分组属于一起的内容 – 你不应该有一个没有标题(H1或类似)的部分描述该部分包含的部分…有几个人在过去犯了类似的错误我认为:
http://html5doctor.com/the-section-element/
从规格:
NOTE: 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. A
general rule is that the section element is appropriate only if the
element’s contents would be listed explicitly in the document’s
outline.
话虽如此,嵌套截面元素是完全可以接受的。也许像:
<section> <h1>Portishead</h1> <p>Portishead are a cool band from Bristol</p> <section> <h1>Dummy (album)</h1> <p>some info....</p> <img src="..." /> </section> <section> <h1>Portishead (album)</h1> <p>some other info info....</p> <img src="..." /> </section> </section>
原文地址:https://www.jb51.cc/html5/169169.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。