Thread: CSS form labels
View Single Post
  #3 (permalink)  
Old Dec 12th, 2006, 11:58
ukgeoff ukgeoff is offline
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS form labels

Your code as shown will not form an association between the label and input elements. The value of the 'for' attribute of the label should match the 'id' value of the input but you only have 'name' attributes and not 'id's.

You can adjust the spacing between labels and their respective inputs and between lines of labels and inputes by using margin and/or padding attributes.

You should not need to use a table to layout your form but some people do find this easier. Some also use the method where each line of the form is enclosed in a <div> element.

Feel free to look at the xhtml and css behind this form: http://1ontheweb.net/enquiries.html
Reply With Quote