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

Home Forums CSS [Solved] structure of a form Reply To: structure of a form


You can structure the internals of a form pretty much any way you want. Some people use tables, some divs…some even use definitions lists

Over on HTMl5Doctor they have a form ‘snippet’ like this:

<form id="app-login" action="process.php">
<legend>Login Details</legend>
  <label for="user-name">Username:</label>

  <input name="user-name" type="email" placeholder="Your username is your email address" required autofocus>

  <label for="password">Password:</label>
  <input name="password" type="password" placeholder="6 digits, a combination of numbers and letters" required>
  <input name="login" type="submit" value="Login">

Divs have no semantic meaning in and of themselves…so can use them however you wish.

So divs are fine…and it would be my preferred option.