Design considerations 4 : Use 'for' attribute with tags

Use 'for' attribute with <label> tags

This simple one was discussed on trac. It may be a good idea to include it here on the community site.

Don't wrap input fields with <label> tags. This is an ancient way to make a relation between a label and an input field, which existed before CSS. It's usage is still valid, but it causes CSS problems increasing the complexity, as input field positionings and styles will all be affected by wrapping labels sitewide.

Instead, use the 'for' attribute of the <label> tag to attach it to an input field. As in :
http://www.w3schools.com/tags/tag_label.asp

DW

 

edit : hmm.. tag names in thread subjects get deleted.