If you’re about to launch a new web product or you just need to improve the user experience for an existing web form, then this tutorial is for you.
In this article you’ll find out how to design a clean and attractive CSS3 signup form.

In the past, I have designed some sign in forms, but never a signup form. So, to get the job completely done, I decided to write this article.
The HTML
Here’s how the markup looks like for this signup form:
<form id="signup"> <h1>Start doing cool stuff in seconds.</h1> <input type="email" placeholder="john.doe@email.com" required=""> <input type="password" placeholder="Choose your password" required=""> <input type="password" placeholder="Confirm password" required=""> <button type="submit">Sign up for free!</button> </form>
For this example, I decided to use a buttton instead of the classic input type="submit". This way, further, it will be a lot easier to target the form’s elements (without adding any id’s or classes).
Placeholder polyfill
You can easily notice the new HTML5 stuff like type="email", placeholder or required. For the placeholder attribute, we’ll add a HTML5 polyfill that will simulate its effect for older browsers.
In this example, we’ll be using Mathias Bynens‘s Placeholder jQuery plugin. That’s a very cool one and it’s highly recommended.
The CSS
As usual, I’ll list below the styles used for this example. Prefixed properties are missing here, but you can find them in the demo page source.
Form styles

After I created a simple 3x4 image pattern, I converted it into a base64 string. To do that, I used this wonderful Image to Base64 Converter tool. You can see it in the styles as a background for #signup.
Regarding the paper stack effect, this time we’re using the ::before and ::after pseudo-elements to do that. Here‘s one of my previous articles where I used a similar technique.
#signup {
width: 550px;
height: 330px;
margin: 100px auto 50px auto;
padding: 20px;
position: relative;
background: #fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAECAMAAAB883U1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAlQTFRF7+/v7u7u////REBVnAAAAAN0Uk5T//8A18oNQQAAABZJREFUeNpiYGJiYmBiYgRiBhAGCDAAALsAFJhiJ+UAAAAASUVORK5CYII=);
border: 1px solid #ccc;
border-radius: 3px;
}
#signup::before,
#signup::after {
content: "";
position: absolute;
bottom: -3px;
left: 2px;
right: 2px;
top: 0;
z-index: -1;
background: #fff;
border: 1px solid #ccc;
}
#signup::after {
left: 4px;
right: 4px;
bottom: -5px;
z-index: -2;
box-shadow: 0 8px 8px -5px rgba(0,0,0,.3);
}
Heading
I tried to create a nice and abstract design for the form’s heading, so here’s my result:

#signup h1 {
position: relative;
font: italic 1em/3.5em 'trebuchet MS',Arial, Helvetica;
color: #999;
text-align: center;
margin: 0 0 20px;
}
#signup h1::before,
#signup h1::after{
content:'';
position: absolute;
border: 1px solid rgba(0,0,0,.15);
top: 10px;
bottom: 10px;
left: 0;
right: 0;
}
#signup h1::after{
top: 0;
bottom: 0;
left: 10px;
right: 10px;
}
Using pseudo-elements (again) :)
Form elements
Not so much to say here. For the submit button, please notice the gradient transition workaround.
::-webkit-input-placeholder {
color: #bbb;
}
:-moz-placeholder {
color: #bbb;
}
.placeholder{
color: #bbb; /* polyfill */
}
#signup input{
margin: 5px 0;
padding: 15px;
width: 100%;
*width: 518px; /* IE7 and below */
box-sizing: border-box;
border: 1px solid #ccc;
border-radius: 3px;
}
#signup input:focus{
outline: 0;
border-color: #aaa;
box-shadow: 0 2px 1px rgba(0, 0, 0, .3) inset;
}
#signup button{
margin: 20px 0 0 0;
padding: 15px 8px;
width: 100%;
cursor: pointer;
border: 1px solid #2493FF;
overflow: visible;
display: inline-block;
color: #fff;
font: bold 1.4em arial, helvetica;
text-shadow: 0 -1px 0 rgba(0,0,0,.4);
background-color: #2493ff;
background-image: linear-gradient(top, rgba(255,255,255,.5), rgba(255,255,255,0));
transition: background-color .2s ease-out;
border-radius: 3px;
box-shadow: 0 2px 1px rgba(0, 0, 0, .3), 0 1px 0 rgba(255, 255, 255, .5) inset;
}
#signup button:hover{
background-color: #7cbfff;
border-color: #7cbfff;
}
#signup button:active{
position: relative;
top: 3px;
text-shadow: none;
box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset;
}
That’s it!

I’m aware that this example does not contain revolutionary techniques, but neither shouldn’t. The possibilities are endless when it comes about web forms styling, as long as you follow up the best and recommended practices.
This is just another cool example created using CSS3′s great power. I hope you will find it useful for your projects, and please don’t forget to leave a comment if you liked it (or not). :)
great one very helpful…………….!!!!!!!
Catalin, you write
“I’m aware that this example does not contain revolutionary techniques, but neither shouldn’t”, but also the wheel was not invented yesterday, but was found and will find all the new use!
The possibilities CSS3 are almost endless!
Thank you for your work.
As always, strong and very useful work!
Catherine Khetagurova.
Thanks for the information, but it could have been better if we get to download the source files, thanks anyway !
You can just view demo source and copy&paste. There’s no additional image or file to download.
Good luck!
Another super gorgeous result by a surprisingly easy tutorial. Keep up the good work.
The form is awesome, I’ve booked marked the page as I will really want to use this design or similar on future projects really nice share, thanks.
This tutorial helps me have more knowleague about converting images into a base64string. It’s so great. “Cám ơn rất nhiều” – English means: Thanks you so much! :D
Hey red, i have a question, why do you use base24 string replace images? base24 string load faster than images? ?_?
I guess you mean “base64″. :)
For this example, I used it just to save a HTTP request. Also, this way I didn’t need to use extra image for that background.
PS. I’ve removed your other comments, please contact me if you have other questions.
Nice use of CSS3 features!
This site is just awesome. Recently discovered it and bookmarked it right away. Frequently checking for updates. Keep up the good work.
Dear Sir,
Earlier I was using Kontera for “Contact Me” form.
But that site went off since 2-3 weeks so I did a makeshift arrangement by tweaking feedburner’s “Email Me” example
http://feedburner.google.com/fb/a/emailFlare?to=demo@gmail.com&itemTitle=Mrunal&uri=http%3A%2F%2Fmrunal-exam.blogspot.com%2F2012%2F03%2Feconomy-reliance-kg-basin-issue-reason.html
So How do I implement beautiful design this on feedburner contact page.
Is there a way by modifying something under ?
Dear Sir,
First of all thanks for your beautiful explanations and demos of CSS.
Your earlier posts on horizontal navigation menu and ordered-list-styles were terrific and awesome.
I made slight modification in your Ordered-list-styles and created a verticle navigation menu with rotational effect and implemented it in my blog, check them out
http://mrunal-exam.blogspot.in/
I request you to upload more a tutorial on verticle navigational menu (with menu and sub-menus features).
like this one : http://www.red-team-design.com/css3-dropdown-menu
but on vertical format.
I’ll be really grateful. Thanks in advance.
Have a great week,
Mrunal Patel.
Good Man
Thank you :)
Looks good indeed.
Didn’t know about the placeholder plug in. BRILLIANT stuff. Many thanks.
What code do we copy for HTLM5?
I’m not sure about your question, but you can check the demo’s page source. Then, you just need to Copy & Paste!
Good luck! ;)
Thank You!
Very good idea, i really love it. :)
You always do great stuff. But you know, I have this kind of implementation but when I put it before a user and he asked a question, if the form has say 6 fields, if he has filled one and he needs to change the content he entered, there’s no way of knowing what the field was supposed to contain. Say for example, he has a field that says car color has the placeholder, and he filled in brown now he looks at brown and he does not remember what the brown was for. Don’t you think it would be a great idea to have a hint to remind him whenever he forgets?
Nice idea man, thanks :))
Sorry, i Cant Do It For Blogspot :( .
this tutorials very helpful to me,thanks
Hello
Mam/Sir
This Tutorial is very helpful for my practice.
Thanks
Thanks!This is very helpful for me
Very Clean and Nice.. Thanx :)