« Recipes

HTML Recipes


Since a login form is a self-contained, complete composition, and could be reused in various document contexts, article is an appropriate element to wrap it.

We use header and footer for common login form aspects like a form title and registration link. See other recipes for details on forms and form validation.

<label for="username">Username</label>
<input type="text" id="username" name="username" />
<label for="password">Password</label>
<input type="password" id="password" name="password" />
<a href="...">Register</a>


The article element |  The header element  |  The footer element

Deeply understand semantic HTML authoring and CSS with my course:
Understanding HTML and CSS.