I am happy to present a new thing on CSS Globe: CSSG Collections! Approx. once a months I will design, code and give a way a collection of certain web elements for free. First in the series of CSS(G) collections are web forms. I am giving away 5 uniquely designed and coded web form styles. Hope you'll find them useful!
Take a look at the forms | Download CSSG Forms Collection

If you like these forms and want more of these collections, please consider bookmarking this page to your favourite social bookmarking service :)
In this collection I used my typical form markup. I always use FIELDSET and LEGEND elements although I sometimes hide them. I find FIELDSET element to be very useful in presentation, because I have an extra element without jeopardizing semantics. i.e. I can combine FORM and FIELDSET to achieve double backgrounds, or use them for vertical "sliding-door" as I did in my first example.
Here's my typical markup:
<form id="form5" action="/" method="post"> <fieldset><legend>Contact form</legend> <p class="first"> <label for="name">Name</label> <input type="text" name="name" id="name" size="30" /> </p> <p> <label for="email">Email</label> <input type="text" name="email" id="email" size="30" /> </p> <p> <label for="web">Website</label> <input type="text" name="web" id="web" size="30" /> </p> <p> <label for="message">Message</label> <textarea name="message" id="message" cols="30" rows="10"></textarea> </p> <p class="submit"><button type="submit">Send</button></p> </fieldset> </form>
Also, as an announcement, I am currently developing a jQuery plugin for text fields and text areas that will handle their behavior and validation. Stay tuned for more on this subject.
Designer, developer and a passionate standardista. Long time web professional with huge experience in all types of front-end work. Founder of Css Globe and creator of
Tim Wright on 14 Jan, 2009 wrote:
A display:block on the label will give you the same output look.
Kudos on <button> though, very underused element!
my2cents
cssglobe on 14 Jan, 2009 wrote:
ST on 14 Jan, 2009 wrote:
jose on 14 Jan, 2009 wrote:
WebmasterNeal on 14 Jan, 2009 wrote:
Brad Czerniak on 14 Jan, 2009 wrote:
Todd Zaki Warfel on 14 Jan, 2009 wrote:
Flash on 14 Jan, 2009 wrote:
nathaniel on 14 Jan, 2009 wrote:
Noticed you said that you are currently creating a jQuery plugin, will it be able to integrate with the Validate and Forms plugins?
nathaniel
Dr. Ritalin on 15 Jan, 2009 wrote:
It's great. Thank you.
Asger on 15 Jan, 2009 wrote:
Concerning the markup I think divs are the most appropriate tag instead of the p's. Semanticly it's not a paragraph, it's not a list and it's not a definition list - It's a division! One could give the div a semantic class name of 'formelement' if you need a specific hook for you css...
oooh on 15 Jan, 2009 wrote:
cssglobe on 15 Jan, 2009 wrote:
Jimmy on 15 Jan, 2009 wrote:
jessabean on 15 Jan, 2009 wrote:
I agree with Todd in that lists make more sense. Either an ordered list or a definition list.
cssglobe on 15 Jan, 2009 wrote:
Francis Wu on 15 Jan, 2009 wrote:
However, another reason is to avoid styling conflicts and the use of too many style hooks.
If I were to use P to wrap controls, it may conflict with using P to wrap instructions at the beginning of the form.
I also avoid the use of LI to wrap controls because I use those for listing check boxes and radio buttons, which can appear in either lists or inline.
ST on 15 Jan, 2009 wrote:
*response to your twitter question*
Dan B. Lee on 15 Jan, 2009 wrote:
cssglobe on 15 Jan, 2009 wrote:
Mark Aplet on 15 Jan, 2009 wrote:
webdawson on 15 Jan, 2009 wrote:
I don't know why but in most of my projects i use div's to wrap input & label...i'm not the big <p> fan but its also a good way.
Jason Huck on 15 Jan, 2009 wrote:
Vladimir Carrer on 15 Jan, 2009 wrote:
Jimmy on 15 Jan, 2009 wrote:
Jimmy on 15 Jan, 2009 wrote:
Sam Benson on 15 Jan, 2009 wrote:
Vladimir on 15 Jan, 2009 wrote:
Let's start with old Tables, we don't need CSS with the tables. Problem much unnecessary HTML code and the tables shouldn't be use as constructors.
Lists lists are great for making "lists" but not for Form building.Do you thing is natural to put your for inside a list?
Imagine the list and the form together without CSS formatting!? Continue >>
Vladimir on 15 Jan, 2009 wrote:
Then we have p, putting form inside paragraph hmm.No thanks.
My personal logical solution is BR . And the form will look great and natural even without css.And not to mention less code then anything else.
Imagine:
1 2 br
1 2 3 br this is something natural to write
And the last solution just pure CSS, how the HTML code will look like without CSS?
I did a lot of research on web forms and css.My advise use BR!
Luka Vida on 15 Jan, 2009 wrote:
Luka Vida on 15 Jan, 2009 wrote:
Jimmy on 15 Jan, 2009 wrote:
Using a paragraph tag would also be problematic unless using a CSS reset, since paragraphs have differing default margins/paddings for various browsers. It is also my firm belief (as stated above) that paragraphs are for text. The specification would be blatantly violated if you were styling your labels/inputs as block elements.
A DIV makes the most sense according to styling and being in accordance with the HTML spec.
Mark Aplet on 15 Jan, 2009 wrote:
Asger on 15 Jan, 2009 wrote:
Vladimir on 15 Jan, 2009 wrote:
mike on 16 Jan, 2009 wrote:
Jesse on 16 Jan, 2009 wrote:
Dainis Graveris on 18 Jan, 2009 wrote:
Hassan on 19 Jan, 2009 wrote:
Zach on 22 Jan, 2009 wrote:
chris on 10 Feb, 2009 wrote:
If you align inputs in multiple columns with separate fieldset's the tabbing direction will be incorrect. Any suggestions? I can only think of table's being the stable way for multi-column form layouts (bring on display:table)
Ibrahim on 9 Mar, 2009 wrote:
The forms are really good. I like no.3 and no.2
My opinion about mark up is , i prefer divs.
elcodigodebarras on 10 Mar, 2009 wrote:
jason on 12 Mar, 2009 wrote:
Also I too have been using p elements to wrap my labels/form elements but after reading all these opinions I believe I will start using divs since it seems to be the best overall semantically acceptable way to do it.
Kaveh on 19 Mar, 2009 wrote:
thanks again.
Guntas on 24 Mar, 2009 wrote:
dlv on 27 Jun, 2009 wrote:
thanks a lot for share
we will be stay tuned for more of this articles!
adeux
sasdaman on 28 Jun, 2009 wrote: