Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Colored form buttons? It's a long shot...

Status
Not open for further replies.

ScoobyDood

Programmer
Jun 10, 2002
15
US
I was just wondering if there is any way to change the color of form buttons. I've never seen it done, so I don't think it's possible, but it never hurts to ask. Thanks. Computers - Can't live with 'em, can't live without 'em! Check this out:

 
<input
type=&quot;button&quot;
value=&quot;hello&quot;
style=&quot;background:white; color:black; border-color:white;&quot;
> ---------------------------------------
wmail.jpg


someone knowledge ends where
someone else knowledge starts
 
It is possible, though doesn't work in all browsers the same way.

.btn1 {
background-color: #f8e858;
font: bold 10pt verdana, arial, sans-serif;
color: #FF0000; // text color
width: 200px; // button width
height: 100px // button height
}

This definition applied to <input type=button> works completely in IE5+ and Mozilla/N6 and partially in Opera and NN4.x

NN4.x - the only thing that works is font definition
Opera - everything works except text and background color.

In addition to this, Opera developers claim that these things are not specified in W3C standards thus they don't hurry to support all of them.

You can also add styles to other form elements like text fields and textareas, taking into account the existing limitations.
The element you can't affect too much on is <select>.

good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top