Button Properties
Moderator: General Moderators
-
Majoraslayer
- Forum Commoner
- Posts: 64
- Joined: Thu Jun 30, 2005 11:50 am
- Location: In Your Mind...
- Contact:
Button Properties
I was curious, how would I change the color and size of a submit button?
-
Majoraslayer
- Forum Commoner
- Posts: 64
- Joined: Thu Jun 30, 2005 11:50 am
- Location: In Your Mind...
- Contact:
There are two ways to do it: inline and ..um.. non-inline - by declaring the properties in the stylesheet:
You could also just overwrite all "input" style and eliminate the need to make your submit button a special class. I wouldn't recommend that though as that tends to make radio buttons look like crap in IE.
Code: Select all
<input type = "e;submit"e; style = "e;width:50px;background-color:#FF0000;"e;>Code: Select all
<style type = "e;text/css"e;>
.mysubmit{
width:50px;
background-color:#FF0000;
}
</style>
...
<input type = 'submit' class = 'mysubmit'>Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
-
Majoraslayer
- Forum Commoner
- Posts: 64
- Joined: Thu Jun 30, 2005 11:50 am
- Location: In Your Mind...
- Contact:
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Why don't you try?
But to answer your question the style will apply to anything with that class unless you say otherwise.
So lets say you have td's, input's, and whatever else all the with the same class name, but you want only certain elements to get certain attributes, you can do the following
But to answer your question the style will apply to anything with that class unless you say otherwise.
So lets say you have td's, input's, and whatever else all the with the same class name, but you want only certain elements to get certain attributes, you can do the following
Code: Select all
<style>
.whitebg {
background-color: #FFF;
}
input.whitebg {
padding: 3px;
}
</style>
<table>
<tr>
<td class="e;whitebg"e;> <input type="e;submit"e; class="e;whitebg"e;> </td>
</tr>
</table>