html - 在 html5 中带有标题的表单的 div 或部分?

标签 html

我只是想知道在 html5 页面上放置表单的正确方法。我似乎找不到任何关于表格的信息。

我的页面是一个联系页面,其中包含带有标题和所有内容的文章元素(Wordpress 页面)。我正在向页面添加一个联系表单,它有一个标题。他们应该在 <section> 中吗?或 <div>

<div>
  <h3>title</h3>
  <form></form>
</div>

<section>
  <header>
    <h3>title</h3
  </header>
  <form></form>
</section>

最佳答案

HTML5 规范将其定义为 -

The section element represents a section of a document, typically with a title or heading.

因此,我建议将带标题的表单放在您指定格式的部分中。

关于html - 在 html5 中带有标题的表单的 div 或部分?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7083654/

相关文章:

javascript - 在 Angular2 中实现 Google ReCaptcha

html - 背景图像和 Bootstrap 3 的问题

javascript - 为 iframe 准备 html 代码时附加 &lt;script&gt; : without executing

javascript - 如何在网页加载时隐藏元素

html - 链接到 CSS 样式表

html - CSS float 对齐

jquery - 如何弹出jquery窗口播放vimeo/youtube视频?

html - 在所有浏览器中设置统一的 &lt;input type ="file"> 宽度

python - 如何在 HTML 文件中包含 python 脚本?

python - 如何在 Python 中提取 <h1></h1> 之间的文本?