Example Navigation
Example 2: Text box control with label as content
Best Practice Rating: Fail
- Text boxes labeled using the
value are inaccessible!
- Using the
value attribute is poor labeling practice for all users since as soon as someone starts typing into the text box the label disappears.
Example Start
Example End
HTML Source Code
<div class="text">
<input type="text" size="30" name="email" value="Name"/>
</div>
<div class="text">
<input type="text" size="25" name="email" value="E-mail"/>
</div>
<div class="text">
<textarea rows="5" cols="50" name="comment">Comment</textarea>
</div>
CSS Source Code
<style type="text/css">
div.text input,
div.text textarea {
margin: 0;
padding: 0;
margin-left: 20px;
margin-bottom: 1.25em;
}
</style>