26 Essential CSS Submit Button Enhancements

by Lars on June 3, 2009

Essential Submit Button Enhancements

Typically a press on a web page button indicates that a user is making a decision of some kind. Buttons are for that reason very important elements and they need to be well integrated with the overall design, easy to spot and use. Styling of buttons is typically achieved using CSS and graphic elements but there are a few other techniques available as well. This article first cover the basics of using a CSS submit button on web pages and then dig into more advanced techniques for applying enhancements to a CSS submit button.


WooThemes - Made by Designers
WooThemes - Made by Designers

Advertisement

This article does not cover styling of image links that is closely realted to styling of submit buttons but usually used for menu navigation. I have covered CSS techniques for navigation in a previous article that you may want to look at – 100+ Massive CSS Toolbox.

CSS submit button basics

In order to use the techniques listed in this article you need to know the basics of HTML and in particular knowledge of building HTML <form> structures is essential. Below I have added an introduction that will teach you what you need to get started using the techniques listed below. If you’re already familiar with HTML and building <form> structures you should just skip this sections.

In order to create an HTML form CSS submit button, you can use the HTML code below. Basically a CSS submit button is a HTML Input field of type submit:

 <INPUT type="submit" name="mysubmit" value="Click!">

name: specifies the identification assigned to this submit button.

value: is the label that appears on the button. The code above will create the CSS submit button as shown below (added as image to avoid css from tripwire magazine template to influence the presentation):

slideshow

This CSS submit button will have no funtion at all as it is not embedded into HTML <form>. I the button is added to a <form>clicking it will load the page specified in the forms action property.The name and value properties of the button that is used to submit the form is passed along with the other data to the server script. For the CSS submit button above, when you click on the submit button, the data passed to the server side script is mysubmit=Click!

If you need to read up on using HTML forms I recommend that you visit w3schools.com HTML Forms and Input tutorial.

Changing the look of a submit button is easily acheived with CSS if you stick to the basics like colors and broders. Here is an example creating a css class called “red” that will be applied to input fields. Adding class=”red” to the CSS submit button will make it pick up the new style.

<style type=text/css>
input.red {background-color: #cc0000;}
</style>

<input  class="red" type="submit" value="Submit">

slideshow

I don’t think it makes sense to go into more details here but I highly recommend that you visit this great css introduction resource if you need more basics: CSS Basics. Another good introduction can be found here: 20: HTML forms—the basics

Button Enhancements

Beautiful CSS submit button with icon set

If you love clean love clean design and in general simple solutions to design nice and attractive elements for my websites, this tutorial illustrates how to design nice clean buttons using some lines of HTML, CSS code and proxal icon set.

slideshow

UI technique: changing submit button appearance via background images

“Now every so often, in my applications there will be a fair bit of processing going on after a form submission– enough to make for a delay of a second or more before the browser redraws the screen. This can happen particularly when the form allows for a file upload. And I know people for whom that one-second delay is enough to make them wonder if their click was received. So they click again… and perhaps again… and in the process, send several identical requests up to the server (probably making the page-refresh delay even worse for themselves). So, my solution is to change the state of the submit button after the first click to let them know that there is, indeed, something going on after the first click”

slideshow

Submit A Form Without Page Refresh using jQuery

“Previously on NETTUTS, Philo showed how you can use jQuery to add form validation to wordpress comments that works without any page reload. Another great way of utlizing jQuery to enhance user experience is to not just validate, but to submit your form entirely without a page refresh. In this tutorial I’ll show you how easy it is to do just that — submit a contact form that sends an email, without page refresh using jQuery! (The actual email is sent with a php script that processes in the background). “

slideshow

Preventing multiple page requests after double-clicks

To prevent multiple clicks from sending more than one request, you can use a JavaScript that does up to two things: first, you can use the “return false;” function of a hyperlink or submit button to prevent any click after the first from sending a request, and second, you can change the link or button to a disabled state so that the browser won’t accept clicks and the user can see that a request has already been sent.

<input type="submit" name="save" value="Save" onclick="this.form.submit(); this.disabled = 1;" />

Simple Image CSS submit button Rollovers with jQuery

Have you ever wanted a simple rollover technique with a form submission button? Something like this:

slideshow

… without having to resort to a complicated mess of javascript form submission and cross browser compatibility issues? With jQuery it’s really easy

How to make sexy buttons with CSS

This tutorial will teach you how to create pretty looking textual buttons (with alternate pressed state) using CSS. Dynamic buttons save you heaps of time otherwise spent creating graphics and will basically make you a happier person at the end of the day.

slideshow

The ULTIMATE CSS submit button REVEALED!

See how Eric Graham, “The Conversion Doctor” creates what he likes to call “The ULTIMATE Submit Button”! He first noticed a border around a submit button about 4 years ago when he saw it on Google’s Adsense Log-in page. Since that time he tested several different variations and colors of borders around submit buttons and in most cases a red border converts best.

slideshow

Rediscovering the Button Element

Creating a consistent interface for your users is a constant struggle for every application designer. Building consistency on the web is especially tough because the visual rendering differences across browsers and operating systems are wildly different and almost arbitrary in what can and cannot be done. No where does this become more apparent than when you’re dealing with form elements and the biggest loser of them all in the battle for a standardized look is the infamous CSS submit button.

slideshow

CSS Oval buttons

These buttons use the sliding doors technique of CSS, plus two sliced background images with “on” and “off” states.

slideshow

4-Style your Form Buttons with Only CSS and Zero Javascript

show you how to style CSS submit button without any JavaScript and how to make rollover effect! can you believe it ZERO JavaScript and tested on all browsers.

slideshow

Scalable CSS Buttons Using PNG and Background Colors

Create dynamic CSS buttons using PNG, transparency and background colors that degrades nicely and supports full scalability. With full scalability it means it should resize in all directions according to the font size and content.

slideshow

Make fancy buttons using CSS sliding doors technique

This article will show you how to create fancy buttons using CSS sliding doors technique. It is much better to use this technique than to use image buttons because you can apply the style to any link and at the same time you don’t have to create an image for each CSS submit button.

slideshow

slideshow

3D CSS buttons

By using an element’s border-style CSS attribute to outset, you can easily create a 3D looking CSS submit button. Taking it one step further the button can also appear depressed if desired, by switching from a border-style value of outset to inset.

slideshow

Pressed Button State With CSS

The active anchor state is the state an anchor (a link) is in when you click on it. The moment you click on a link, it becomes active. You will use the “hover” or “visited” states in this tutorial, but the active state can come in very handy when you’ve got custom styled buttons.

slideshow

CSS Sliding Door using only 1 image

In this tutorial, you will be shown how to code the navigation bar using only 1 image, making it user friendly and uses less CSS code.

slideshow

The buttons are designed to look very similar to basic HTML input buttons. But they can handle multiple interactions with one basic design. The buttons we’re using are imageless, and they’re created entirely using HTML and CSS, plus some JavaScript to manage the behavior. They’re also easily skinnable with a few lines of CSS, which was a key factor now that Gmail has themes.

slideshow

Roll Over CSS submit button

In this XHTML CSS tutorial you’ll learn how to create a button for a web page using Photoshop, XHTML and CSS. More specifically, you’ll learn how to create a button who’s hover state image is preloaded. The advantage to this technique is that upon hovering over your button, the user won’t have to wait for it’s hover state image to appear; there’ll be no ‘graphic-less’ moment while the image loads, all without a single line of JavaScript.

slideshow

Liquid & Color Adjustable CSS Buttons

When working on a large site with multiple buttons, it can be quite tedious to make all the buttons in Photoshop. Making future adjustments on the verbiage and colors can be also time consuming. By having dynamic buttons, this scenario is much easier to handle, and by having liquid and color adjustable buttons with CSS, we are able to change the verbiage and colors with ease.

slideshow

CSS Hover Button

In this tutorial, to start with, you will need to make an image in two different states (state number one will be the natural state and state number two will be the hover state) and bring the button altogether with CSS.

slideshow

Submit button should look same everywhere

When some one works on a website design, it is important that the look will remain same in all browsers. But creating a consistent interface for users is a constant struggle for every application designer. Building consistency on the web is especially tough because the visual rendering differences across browsers and operating systems are wildly different and almost arbitrary in what can and cannot be done.

slideshow

CSS Overlapping Arrow Buttons

“I was recently asked to create arrow buttons for a step-through type of navigation. At first, from a CSS standpoint, it seemed like trying to fit a triangle peg in a square hole. But with a little creative maneuvering I was able to work it out. I’m sure there are many ways… but here’s my approach.”

slideshow

Pure CSS Buttons v1.0 by Halmat Ferello

This is simple and effective way to have buttons that scale (width-wise) without any weird browser-specific CSS (apart from IE6/7) or JavaScript implementations. Just using pure CSS goodness.

And since we should care about the user, the buttons also offer feedback – hence different images for :hover, :active CSS events.

slideshow

CSS image replacement for submit buttons

Expanding the techniques for CSS image replacement by Mike Rundle and Seamus P. H. Leahy, and inspired by a question posted to the WebDesign-L mailing list, I have developed an image replacement method for submit buttons, and in general for the button tag.

Using this method you’ll get a clickable image when style sheets are active, and a standard CSS submit button when style sheets are off. The trick is to apply the image replace methods to a button tag and use it as the submit button, instead of using input. And since button borders are erased, it’s also recommendable change the button cursor to the hand shaped one used for links, since this provides a visual tip to the users.

slideshow

Simplest transparent css submit button ever

Really simple submit button and a good description on how to implement it.

slideshow

Update: Styling the Button Element with CSS Sliding Doors – now with Image Sprites and IE 8 Support

We dusted off our original sliding doors CSS submit button to give it a much needed update. The button now works with image sprites thanks to the CSS contributions of Louis Walch, and also works with a single block of CSS (we’ve removed the now unnecessary conditional comments for IE) in all major browsers including IE versions 6 through 8.

slideshow

{ 43 comments… read them below or add one }

Danh ba web 2.0 June 4, 2009 at 3:20 am

Good tutorial. Thank you very much
Keep up !

Reply

Semblance June 4, 2009 at 11:48 am

This is great. I will definitely use some of these ideas. Getting that button clicked is important!

Reply

Rahul June 4, 2009 at 4:32 pm

This is just awesome man. I love it. Bookmarked!!!

Reply

Sean June 4, 2009 at 4:37 pm

Thanks! Some of these are exactly what I was looking for.

Reply

Prasanth June 4, 2009 at 6:08 pm

Very nice. Will use some of the ideas in the next update of Simfatic Forms.

Reply

Jim June 4, 2009 at 9:48 pm

Great! Thanks for posting this. I have had a hard time finding this information easily on places like Sitepoint, even though they have good CSS articles on styling forms.

I bookmarked the Ultimate Conversion button too. — http://bit.ly/4GL6G
That was interesting how something so simple could have such a big effect.

Reply

tripwiremag June 4, 2009 at 10:08 pm

Thanks all for your positive feedback.
@Jim. I agree that the Ultimate Conversion stuff is worth investigating. If you really need a click this technique may be just what is needed.

Reply

Raymond Selda June 5, 2009 at 6:04 am

I love this article! Most of the time I get the ideas from checking out how big sites style their buttons. This is really comprehensive. Bookmarked! Thank you.

Reply

jlbraaten June 8, 2009 at 4:00 am

Thanks for all the great ideas for my upcoming multivariate testing. 3% different on the green button rollover, eh? Nice.

Reply

????? July 11, 2009 at 12:25 am

very Nice,
essa

Reply

DeveloperNetwork July 24, 2009 at 3:07 pm

Very good,interesting article.
Some of these have been included in older articles and i’ve seen them before.

Some are completely new to me like the ajax submit one.
The title is 100% true.
It’s essential!

Reply

tripwiremag July 24, 2009 at 4:02 pm

@DeveloperNetwork, Thanks for the feedback! Buttons are key to picking up user input. Yes having good buttons is absolutely essential ;)

Reply

jcargoo August 7, 2009 at 6:28 pm
Andrew Dunkman August 11, 2009 at 1:06 pm

I love the CSS styles presented on this page: http://particletree.com/features/rediscovering-the-button-element/

Reply

Custom Doors December 18, 2009 at 9:49 am

This is interesting article which is use some of these ideas Submit Button Essential Enhancements tripwire magazine like tags,button,submit.getting that button clicked is important to have had a hard time finding this information easily on places like Sitepoint, even though they have good CSS articles on styling forms.Some of these have been included in older articles and i’ve seen them before.

Reply

Mario January 21, 2010 at 5:31 pm

Great article and excellent examples. However, the code in your first example is semantically incorrect. You cannot place a span tag inside an input tag. Please see my suggestion:

input.red
{background-color: #cc0000;
color: #FFF;}

Reply

yc July 14, 2010 at 10:56 pm

I think that tag is an encoding error. It’s meant to be colored red in the example, not run as semantically weird code.

Reply

Ferienwohnungen oberammergau March 7, 2010 at 8:37 pm

Good tutorial. Thanks for sharing

Reply

Elektrische Zahnbürste April 17, 2010 at 10:57 pm

Well this post really helped me out. I did not know all of this information and am very glad to have read this article.

Regards
Zahnbürste

Reply

Mix Newz June 7, 2010 at 7:10 am

I love the CSS styles.You Give Me Helpful Tips Thanks Buddy

Reply

gewinnspiel June 25, 2010 at 11:34 am

I was looking for a clean css solutions for my navigation for a few days now, this sliding door css technique is really good. I think my site will look great with the redesign.

Reply

hermes handbags July 4, 2010 at 5:12 am

Thanks for all the great ideas for my upcoming multivariate testing. 3% different on the green button rollover, eh? Nice.

Reply

hermes handbags July 4, 2010 at 5:13 am

great list for learning the layout of wordpress! If you need help making themes, hit up my website and follow some tuts for Photoshop

Reply

6 bottle wine coolers August 17, 2010 at 2:57 pm

Thank for sharing!

Regards
6 bottle wine coolers

Reply

Neytiri September 1, 2010 at 12:01 am

Thanks I can use some of those buttons on a new site I am Building…

Reply

sms flirt September 23, 2010 at 9:29 am

Great article, i get some new ideas to design some of my buttons. Now i can make a better design without the use of images.

Reply

greetings February 3, 2011 at 10:04 am

how can create a button using with height and width ? eg : i want a square button 100px

Reply

Konzert Tickets February 22, 2011 at 5:04 pm

wow i learned a lot about button design

thank you

Reply

Tickets February 22, 2011 at 5:05 pm

Thanks for all the great ideas for my upcoming multivariate testing. 3% different on the green button rollover, eh? Nice.

Reply

Web Design Mauritius February 24, 2011 at 12:43 pm

Thanks for sharing. Really interesting.

Reply

Elektrische Zahnbürste March 1, 2011 at 4:03 am

thank you very much nice

Reply

Tour Karten March 16, 2011 at 5:58 pm

Thanks a lot, I was looking for the CSS Overlapping Arrow Buttons for a while.

Reply

Googly April 16, 2011 at 4:21 pm

How to add submit button shown below “Submit”

Reply

Peter Johansson May 6, 2011 at 8:34 pm

Thanks for sharing. Form and button design is not very easy to implement. It need’s to be as trust worthy and professional as possible.

Reply

Eventspion May 30, 2011 at 7:04 pm

I prefere the coloured oval buttons solution. Thanks a lot for the tutorial and overview.

Reply

Usi June 27, 2011 at 6:46 pm

After seeing few other sites, not all examples here look so nice or practical. I prefer onpage generated buttons with CSS. CSS3 has some cool new functions for buttons as I saw. Thanks for sharing anyway!

Reply

Lars June 27, 2011 at 9:54 pm

I completely agree with your that today the right option is to use on page css generated buttons and not images…

Reply

Ryan Barcelo June 29, 2011 at 5:36 am

I created a button design in my website. Check it out.
It’s the kind of button that nobody can ever choose no. :)

http://www.ryanbarcelo.co.cc/HTMLExperiment2.ubr

Reply

Glasgow Web Design August 15, 2011 at 2:52 pm

Great list of tutorials. Thanks for sharing

Reply

Web Hosting September 13, 2011 at 2:48 pm

Really useful and nice buttons, I am sure web hosting people will love this tutorial.

Reply

Hannes October 11, 2011 at 6:43 am

My cross-browser button code in jsFiddle: http://jsfiddle.net/hkirsman/fmpg2/

Reply

PLR Ebooks November 9, 2011 at 12:27 am

Hi

in my website, i have used one of the sets available above. But i changed the color.

Regards
Venkat

Reply

Ken November 18, 2011 at 12:26 am

Just the advice I need to fix up my submit buttons. Thanks for the great article!

Reply

Leave a Comment

{ 13 trackbacks }

Previous post:

Next post: