SEOSumo Latest Articles SEO Tools

Bookmark and Share

Simplest transparent CSS submit button ever. The Levitating Submit Button

There are many CSS techniques to get specific features on a submit button, but here is one that uses a single image, and no extra markup (like b or i tags) for a transparent (no opaque patches) elastic css button. I named this version:

Levitating Submit Button

Tutorial Levitating Submit Button Diagram by Sergio Zambrano

  • Pros
    • Uses a single image
    • Transparent
    • Elastic
    • Doesn’t depend on white corners/patches to hide a portion of the image like the sliding doors version
    • Uses minimal markup
    • The form can be submitted hitting enter, because it’s the actual submit button, and not a link with a JS submit function.
    • Cross Browser (Firefox and IE7, that I’ve tested, but I’m sure it can be easily used in other browsers and in older ones with common transparency hacks)
  • Cons
    • Background can’t be switched without JS in browsers not supporting :hover in other than <a>.
    • Can’t have elements stacked to the right.
    • Let me know if you find another!

How it looks?

See it below in any comments box. I’m sorry. I can’t add the button here because I can’t stop wordpress from adding extra br tags before input tags!

How it works

The input button falls completely outside of a container label tag which only has enough width to show the left padding of the button in its background, but since the label has its overflow property set to “visible”, it shows the input button anyway, hanging to the right.

10 Comments

  1. by sergio
    July 23, 2009
    5:19 pm

    Louis, the button rollovers fine. It just wasn’t the point of this post. I updated my comment’s submit button to do so. Also, I saw the button you directed me to, and when I say “single image” I don’t mean just the faster loading but the simple creation. Having to cut a button in pieces annoys me. Not even mentioning to merge them into sprites.

  2. by Mike T.
    July 23, 2009
    6:21 pm

    Wow, this looks really nice.

    Can I ask why you chose to wrap the \ in a \? Semantically, I can’t figure out what that’s adding, given that the label doesn’t actually contain any text. How is this approach better than just a plain old \ or ?

  3. by Mike T.
    July 23, 2009
    6:21 pm

    Oh boy, it swallowed the tag names, despite my escaping efforts. I was asking why you’ve wrapped the input in a label, rather than a span or a div. :S

  4. by gondo
    August 5, 2009
    11:15 am

    your html is totaly wrong, check documentation how to use label element
    http://www.w3.org/TR/html401/interact/forms.html#h-17.9

  5. by sergio
    August 7, 2009
    10:10 pm

    Gondo:
    This page may have tens of validation errors… but that button is not one of them. I’m open to suggestions about what tag would work better than label semantically or in any other aspect.

  6. by shityoucantremember
    August 12, 2009
    7:08 am

    This makes me wonder if you have even considered trying it in IE6.

  7. by sergio
    August 14, 2009
    3:42 am

    I don’t even consider IE6 for web developing. Sorry.

  8. by amanda
    September 30, 2009
    8:03 am

    I am creating a rollover state for this and it has a glitch. If the mouse is on the left side, it will rollover, but the rest of the button will not.

    Here’s my css:

    .contentSubmitButton{
    background: url(../buttonImages/submitButtonLarge.png) no-repeat top left;
    display: block;
    font:Verdana, Arial, Helvetica, sans-serif !important;
    font-size:13px !important;
    height: 38px;
    width: 16px !important;
    overflow: visible;
    padding: 0px 0 0 0px !important;
    margin:0 0px 0px 0 !important;
    }

    .contentSubmitButton:hover{
    background-position: bottom left;
    }

    .contentSubmitButton input,
    .contentSubmitButton #submit {
    background: url(’../buttonImages/submitButtonLarge.png’) no-repeat top right;
    height: 38px;
    font:Verdana, Arial, Helvetica, sans-serif !important;
    font-size:13px !important;
    color: #02004c;
    margin: 0px 0px 0px 16px !important;
    display: block;
    border: none 0px;
    padding: 0px 16px 4px 0px;
    background-color: transparent;
    cursor: hand;
    cursor: pointer;
    line-height:15px;
    }

    .contentSubmitButton input:hover,
    .contentSubmitButton #submit:hover {
    background-position:bottom right;
    }

    Where have I gone wrong here? I see that your button works great! :o ) Thanks!

  9. by sergio
    October 18, 2009
    11:17 pm

    Amanda:
    Let’s make clear to others that you (I assume) made a sprite with your rollover states and are switching the position bottom or top for the hover state.

    Just add the button to your label’s hover rule. I assume your .contentSubmitButton is applied to the label, so for that case it should be:

    .contentSubmitButton:hover input {
    background-position: bottom right;
    }

    That will switch the background of the input inside the element of class .contentSubmitButton that is hovered.

    I’d use the label (or whatever tag you used for the button’s container) before the .classname like label.contentSubmitButton, just in case some browser can’t hover a class by itself with no element specified.

  10. by amanda
    October 19, 2009
    8:04 am

    sergio, u rock. I just had this incorrect. Works great as this:

    .contentSubmitButton:hover input,
    .contentSubmitButton:hover #submit {
    background-position:bottom right;
    }

    thank you sooooooo much!

RSS feed for comments on this post. TrackBack URL

Leave a comment

SEOSumo Latest Articles SEO Tools

Welcome to SEO Sumo

Welcome to SEO Sumo. We are honored to have you on our site and invite you to experience our culture and our company.

This site was built with a simple purpose: to serve as a resource for finding marketing enlightenment in the digital world. Our dedication to provide the guidance and insight our visitors need to grow their companies is unwavering.

With great diligence, we explore the web in search of tools, educational resources, and experiences which help us master The Art of Digital Dominance.

To understand SEO Sumo, you must take the first step and ask questions:

  1. Who is SEO Sumo?
  2. How do I grow my business through digital marketing?
  3. How do I increase targeted traffic to my website?
  4. What makes Miami SEO worth the investment?
  5. Why is Miami Search Engine Optimization a smart choice for my business?

SEOSumo Latest Articles SEO Tools

The tools will come soon

Stick around for the coolest SEO tools we're developing for you

Previous Articles

Charlie Ellis of SEO Sumo discusses how to focus on the core elements of SEO to achieve maximum results. The entire SEO Sumo and Terremark Search and Sociability in 2010 seminar can be viewed in HD at www.seosumo.com

Charlie Ellis of SEO Sumo discusses how people decide if a website is trustworthy or credible at the SEO Sumo and Terremark Search and Sociability in 2010 seminar. You can view the entire presentation in HD at www.seosumo.com

Charlie Ellis of SEO Sumo discusses SEOmoz’s projection of the Google Ranking Algorithm components. To view the entire SEO Sumo and Terremark Search and Sociability in 2010 seminar – please visit www.seosumo.com

One of the key things to consider when people question the legitimacy of your link data is your source. (more…)

Charlie Ellis of SEO Sumo discusses why people use Google more than any other search engine.

Search Engine usage in the U.S has increased exponentially. (more…)

Charlie Ellis of SEO Sumo discusses how the behavior of search has affected American lifestyle, economy, and business to consumer marketing.

Tremendous thanks to everyone who came out to SEO Sumo’s first presentation at Terremark’s NAP in downtown Miami.  Feedback from our registered guests was phenomenal, and we’ve already started developing a more technical presentation as a follow up. (more…)

Real time search is now

One small leap for Google, one giant leap of faith for SEOs. Real time search is now. (more…)

Vera_compressedLeft: Original image enlarged 300% to show pixels.
Right: Compressed image with the lowest quality, enlarged 300% too.

Many of you who use Photoshop may know more or less how JPG works, and some of you might have a deep knowledge about the algorithm that makes our photos look bad or allows them to be quickly loaded in browsers. This post is for those who know bigger is better, but don’t know why an image gets heavier or lighter.
(more…)

I have to admit…my first reaction to the Chrome OS demo was somewhat lack luster. (more…)


Online invisibility. It can be a nightmare realization. (more…)


Solving the wordpress duplicate content issue is easier than you think. (more…)