Label id vs CSS id?

Hi Folks,

I discovered an unusual conflict in the <label> requirements for HTML forms. It seems that the "id" attribute in a form element must contain the same name as the "for" attribute in the <label> tag in order for these to be related. But if that form element already had a CSS "id" attribute associated with it (for stylistic reasons), then the <label> tag cannot be associated with it. For example:

<label for="fname">First name:</label> <input type="text" name="firstname" id="redBorder" value="">

So where do I put id="fname" in that form element? Are label and CSS "id" attributes mutually exclusive, or am I missing something??? This seems like an awfully obvious conflict of the "id" attribute, so I'm assuming that there is a syntactical workaround of some sort...

Suggestions, anyone?

Thanks in advance.

Emlyn


. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Emlyn Addison
Director of Creative Services
www.RI.gov -  Rhode Island Government Online
401.831.8099 x24

Received on Tuesday, 28 October 2003 10:04:41 UTC