[thelist] accessible way to indicate that a form field is required

Barney Carroll barney at textmatters.com
Fri Nov 17 09:47:13 CST 2006

kasimir-k wrote:
> Maybe not CSS as such, but class: <input class="required" ...>
> And then use CSS to give it appropriate presentation on various kinds of 
> user agents. Using class attribute in a semantically meaningful way can 
> not be a bad thing, can it?
> .k

Never a bad thing, but possible not really that good a thing either. A 
huge emphasis is put on semantic classes and ids, but to be honest we're 
the only demographic that literally stares at the raw code.

The fact that your input has the class attribute "required" is 
completely irrelevant to the vast majority of users, unless it has css 
rules attached to it.

Without css, your website is semantically beautiful for web developpers 
(who can already decipher non-semantic code anyway) but has no 
particularly beneficial properties for the man in the street.


More information about the thelist mailing list