HTML5 - 部分还是Div? [英] HTML5 - Section or Div?

查看:77
本文介绍了HTML5 - 部分还是Div?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习HTML 5 - 非常顺利。

I am learning HTML 5 - going pretty smoothly.

我的问题是我有一个主页,标题,菜单以及这3个内容块下方,均匀间隔。它们每个都包含各种副本,带有标题文本。例如,

My question is that I have a home page, header, menu and below this 3 content blocks, evenly spaced. They each contain various copy, with header text. For example,

第1列

关于我们
Lore Ipsum ......

About Us Lore Ipsum...

我们的优势
Lore Ipsum ...

Our Advantage Lore Ipsum...

第2列

我们的产品
Lore Ipsum ...

Our Products Lore Ipsum...

第3列

联系表格

Twitter Feed

Twitter Feed

联系我们
Lore Ipsum ...

Contact Us Lore Ipsum...

这是什么最好的加价?通常我会在div中的每一列。这是最好的吗?

What is the best markup for this? Normally I would but each column in a div. Would this be best?

<div id="column1">
     <section>
     <h2>About Us</h2>
    <p>Lore Ipsum...</p>
     </section>
     <section>
     <h2>Our Advantage</h2>
     <p>Lore Ipsum...</p>
     </section>
</div>

<div id="column2">
     <section>
     <h2>Our Products</h2>
     <p>Lore Ipsum..</p>
     </section>
</div>

<div id="column3">
     <form...
     <div id="twitter">
          <script...>
     </div>
     <section>
     <h2>Contact Us</h2>
     <p>Lore Ipsum...</p>
     </section>
</div>


推荐答案

我说你发布的代码很好,虽然我个人使用< header>< h1>< / h1>< / header> ,而不是< h2>< ; / h2> ,因为这种情况下的标题是节标题(虽然这是可选的)。

I'd say your posted code is fine, although personally I'd use <header><h1></h1></header>, instead of <h2></h2>, since the headings in this case are section headers (this is optional though).

有关节标题的更多信息可以是发现于:

More information on section headers can be found at:

  • http://html5doctor.com/the-header-element/
  • http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-header-element

这篇关于HTML5 - 部分还是Div?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆