CSS Library: Form CSS: Here
CSS Tableless Form
Author: Dynamic Drive
This is a tableless CSS form which you can use as a template for implementing your own lightweight form. It uses a combination of float and negative margins to create a two column layout for the form. One issue with the form is IE6's three pixel jog bug, which is addressed in the demo manually, by offsetting the jogged checkboxes with an additional margin. You may wish to implement a more thorough fix, though it will increase the size of the code. IE7 does not suffer from the 3 pixel bug.
The form is responsive in that it expands to take advantage of the full horizontal space of the page when the window is 480px or less, or that of most smart phones.
Demo:
The CSS:
Rate this code:
Date Posted: 06/20/2006
Revision History: 06/10/2013 Form now responsive, adapting to windows 480px or less.
Usage Terms: Click here
Got a question or need help customizing this CSS code? Post it in the CSS Forums. If you have a comment or suggestion instead, post it in the comments section below.
Comment Pages 1 of 19 pages 1 2 3 > Last »
Greets!
1. semantically there are no paragraphs (so P should not be used). A simple break would do to get a clear:left and a div could be used to wrap label and field.
2. The labels for checkboxes and radio buttons do not work. By work I mean: if you click them nothing happens. Clicking a label should toggle the field. Click on agree to terms to see what I mean.
I created a page myself where I collected form styling methods and will mention your technique.
See http://michiel.wordpress.com/2006/02/09/floating-forms/
I think the paragraphs are required for validity, though I could be mistaken.
... and in regards to this taking less bandwidth, CSS coding will ALWAYS produce less code than using the traditional table methods, especially if used correctly. It may only be a few kilobytes here and there, but when a site starts getting 1000+ hits a day, it can start to add up. Plus CSS is easier to work with due to the separation of code (if using external CSS files, which is the only correct way to do it).
Visit CSS Zen Garden for proof.


*I recommend this.