About a year ago, we replaced some webpage forms that used tables for layout with CSS-based layouts. Here's the blog post about it, CSS layouts for forms. To cut a long story short, we had some problems but eventually adapted this method to give this form.
Since then, all our forms have been CSS-based and gradually we have learnt more about CSS layouts for forms. Our preferred solution uses Andy King's method. In our experience, this works well with a variety of different CSS-based website layouts and our testing shows no major problems with different browsers.
Some tips might be useful here.
This makes the form style sheet portable between website projects
I always put the CSS rules for my form in a separate style sheet. This makes the form style sheet quite portable between website projects and I can link to it from my form page and not from other pages. During early website development, this means I can concentrate on other things, rather than the form page. Later, I can amalgamate the form style rules with my main style sheet if I so wish. Additionally, a separate form style sheet helped me identify problems with one particular layout. This works great in my experience.
..assess the problems before diving in with style sheet amendments
Use different style sheet tools to assess the problems before diving in with style sheet amendments. Personally, I use Dreamweaver as my main website development tool and its recent incarnations allow me to see style sheet rule inheritance (which rules get inherited from other elements) quite easily. I often found this quite difficult for CSS and forms in the past.
I also use Firebug a lot more for CSS these days. I use it to see how other websites style their forms. It's a great tool and I don't know how I got by without it.
Set aside some time to read about CSS-based form layouts. Understand how they work. For example, The Art and Science of CSS by Sitepoint has a great chapter on form layout and styling with CSS. The chapter is available as part of the free download sample for the book.
Final tip. Find a layout that works for you. Stick with it. Familiarity helps.
Update: Top 5 resources for building contact forms
Stunning CSS3: A Project-Based Guide: Use this book to work through a series of practical yet cutting-edge projects. Each chapter walks you through standalone exercises that you can integrate into projects you're working on, or use as inspiration.
» Buy from Amazon.com · Amazon.co.uk
ThemeForest sell a range of site templates from some fantastic designers. They also sell some great WordPress themes!
Online invoicing made easy with CurdBee!
» Sign up
Join SugarSync for online backup. Sync your files between Mac, PC and mobile phone. Get 5 GB FREE and up to 10 GB bonus space!
HTML5 and CSS3 for the Real World will show you how to create websites using these new methods.
This easy-to-follow guide covers everything you need to know to get started. You’ll master the new semantic markup available in HTML5, as well as how to use CSS3 without sacrificing clean markup or resorting to complex workarounds. Buy the Book! · FREE Chapters