This is not an issue i have with css or html, but on the best way to setup a form for semantic purposes. I’ve seen many way to setup forms an i finally started to set them in un-ordered list, but i know some people uses tables, which one is better?
I am often struggling with styling forms too. But using a ul for a form just doesn’t feel good to me, I think it’s mis-using it for something it wasn’t meant for. @chris: Maybe it’s a good idea to make a screencast about styling forms?
I like to use a definition lists because i see it as users are defining the form fields. The field email is defined to "firstname.lastname@example.org" , the field name to " john doe" etc…. (its hard to explain somehow).
But still, there are a lot of different opinions and solutions about this subject, all of them have their pros and cons.
I don’t use Lists and definately don’t use tabes – in no way can a form be considered tabular data. Forms have their own set of tags – Fieldset, Legend, Label, Select and Input will give you all of the semantic value you should need. The nature of the form content has been defined initially by the Form tag, so anything that follows is assumed to be a form element, making Lists and other non-form related elements redundant in my view. Further meaning can be implied with the addition of id and class attributes.
To use the label tag, simply surround the text that you want associated with a form field with the label tag. If you don’t include the form field inside the label tag, then you should use the for attribute to associate it with the id of the form element you want to label.