Can I style an input button to be just a rectangle with a border?
I would like to style my input buttons to take away all the normal styling and just make them into rectangles with rounded edges. I'm new开发者_JAVA技巧 to CSS. Can someone tell me if it's possible to do this.
John
Yea, sure.
input[type=submit], input[type=button], button {
border: 1px solid #000;
background: #f00;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
There you go.
http://jsfiddle.net/4fW4y/
Example with more bells and whistles:
http://jsfiddle.net/4fW4y/1/
And yea, as Jeroen noted, the fancier effects are supported only in modern browsers.
精彩评论