The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other HTML5 Proper Structure – Form Tag

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #40794

    Hello All!

    With HTML5, we are encouraged to use <article>, <section>, <header>, etc tags in place of the <div> tags when appropriate. Would it be semantically correct to use the <form> tag in the same manner for a form in a webpage and style it as I would one of the above elements?



    To me, it seems logical to use it the first method above. After all, that section of content is a form and adding a <section> or <div> container seems like code bloat. Thanks in advance.


    ‘Form’ itself does nothing so, in essence it’s exactly the same as a div or section.

    Here’s what HTML5 Doctor says:

    > The form element represents a collection of form-associated elements, some of which can represent editable values that can be submitted to a server for processing.

    So in answer to your question…yes, it would be semantically correct to use the ‘form’ element as a wrapper without needing to wrap it in another element.


    Thank you for the quick and well referenced response, Paulie_D. Much appreciated.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Other’ is closed to new topics and replies.