tags:

views:

28

answers:

1

Label tag coding style.

Can I write my label tag like this.

<input type="text" name="lname" id="ln" />
<label for="ln">Last Name:</label>

Instead of like this.

<label for="ln">Last Name:</label>
<input type="text" name="lname" id="ln" />
+3  A: 

Yes, although it is bad practice.

UI design conventions place labels before controls (unless those controls are radio buttons or checkboxes)

David Dorward
Is there css to place the label tags contents before a checkbox?
oReiLLy
While you might be able to reorder it with CSS, you shouldn't because (1) Checkboxes should be before labels, not the other way around and (2) That is better achieved by editing the HTML.
David Dorward