Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

div or section for forms with a heading in html5?

Tags:

html

I just want to know the correct way of putting a form on a page with html5. I can't seem to find anything regarding forms.

My page is a contact page with the content in an article element with heading and all (Wordpress pages). I'm adding a contact form to the page and it has a heading. Should they be in a <section> or a <div>?

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

or

<section>
  <header>
    <h3>title</h3
  </header>
  <form></form>
</section>
like image 678
gavsiu Avatar asked Aug 16 '11 19:08

gavsiu


1 Answers

The HTML5 Spec defines it as -

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

So, I would suggest the form with a heading to be placed in a section with the format you have specified.

like image 74
Aniket Avatar answered Sep 30 '22 18:09

Aniket