views:

3602

answers:

3

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?

+2  A: 

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

danpickett
+1 Awesome. I've used this for a while. Pure CSS, just works.
David Berger
That looks like it is for anchors, and does not seem to support vertical scaling. Or am i missing something?
Buzz
You are missing something - this method can be extended to support the button element - http://www.filamentgroup.com/lab/styling_the_button_element_with_sliding_doors/Don't forget to specify a button type="submit" for IE.I haven't found something with vertical scaling, or had the need for it.
danpickett
This does NOT support form inputs, and does NOT support vertical scaling. Why the hell is this answer being upvoted? I know very well how to deal with buttons, and how to do this without permitting vertical scaling. That's NOT what I asked.
Buzz
+1  A: 

You must use curvycorners to this solution because IE browser will not make it rounded. I haven't tried adding an image though. Just try it out.

<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" />
marknt15
+1  A: 

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.

Hurix
lol ... i don't have multi-line submit buttons, but if a user zooms in, i don't want the buttons to break.
Buzz
404 error on this link.
Chris Porter
Is there a mirror of this page?
UpTheCreek