Home › Forums › CSS › [Solved] structure of a form › Reply To: structure of a form
September 17, 2013 at 3:07 am
#150250
Paulie_D
Member
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">
<fieldset>
<legend>Login Details</legend>
<div>
<label for="user-name">Username:</label>
<input name="user-name" type="email" placeholder="Your username is your email address" required autofocus>
</div>
<div>
<label for="password">Password:</label>
<input name="password" type="password" placeholder="6 digits, a combination of numbers and letters" required>
</div>
<div>
<input name="login" type="submit" value="Login">
</div>
</fieldset>
</form>
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.