Re: Label id vs CSS id?

Why could you not (a) use "class" instead of "id" for

	id="redBorder"

or (b) use "for='redBorder'", since IDs must be unique ?

Philip Taylor
--------	
Emlyn Addison wrote:
> 
> 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...

Received on Tuesday, 28 October 2003 10:09:28 UTC