Example Navigation
Example 2: Labeling select using TITLE
Best Practice Rating: Poor
- Using the
title attribute to define labels will work with assistive technologies but is not defined in the HTML specifications
Example Start
Select pizza crust
Example End
HTML Source Code
<div class="label">Select pizza crust</div>
<select name="crust" title="Select Pizza Crust">
<option>Deep dish</option>
<option>Thick</option>
<option>Hand thrown</option>
<option>Thin</option>
</select>
CSS Source Code
<style type="text/css">
div.label {
margin: 0;
padding: 0;
margin-left: 20px;
font-size: 100%;
font-weight: bold;
}
select {
margin: 0;
padding: 0;
margin-left: 20px;
}
</style>