Question

What I'm looking for is a clean method to round the corners of all inputs with the class "submit". I've experimented with a number of javascript techniques, but none worked well for form elements. Pure CSS would be great, but, note, the button needs to expand, and will have arbitrary text. Other methods required really ugly HTML cruft around the inputs, which I don't want.

Any ideas?

Was it helpful?

Solution

Try CurvyCorners (30,100 bytes, minified) for this solution because IE browser will not make it rounded. I haven't tried adding an image though.

<style type="text/css">
.input-rounded-button {
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    border: 1px solid gray;
    padding:0 3px 0 3px;
    display:inline-block;
    text-decoration:none;
    background:#595651;

    color:#FFFFFF;
    cursor:pointer;
    font:11px sans-serif;
}

.input-rounded-button:hover { 
    text-decoration:none; 
    color:#ADD8E6; 
    cursor:pointer;
    border:1px solid #FF2B06;
}
</style>

<input class="input-rounded-button" type="button" value="SEARCH" />

OTHER TIPS

I've been using this method for a while -

http://www.oscaralexander.com/tutorials/how-to-make-sexy-buttons-with-css.html

It works pretty well

Maybe this one is the kind of workaround you are looking for. Though it doesn't support vertical scaling. (Why the hell do you have multiline submit buttons?)

http://www.hedgerwow.com/360/dhtml/ui-css-input-replacement/demo.php

It's specialized for submit-buttons and supports a fairly reasonable browser range.

If you are able to use CSS3, the easiest way that i know is just to do this:

.button
{
  background-color:#f57070;
  border-radius: 10px;    //-rounding the edges, only available in CSS3-//
  font-family:arial;
  font-size:30px;
  text-decoration:none;
}

with the html code:

<a href=# class='button'>...</a>

makes a nice red button with rounded edges.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top