Click to See Complete Forum and Search --> : [RESOLVED] <button>How do I change its color?</button>
Rianna
05-26-2006, 09:52 PM
Hello, regarding the button maker from W3 schools. That uses the following html code to make it.
<button>This is where the button appears</button>
I have tried several things to change its color with no luck. Anyone know how? Thanks a lot. Rianna
ray326
05-26-2006, 11:16 PM
button { color:#f00 }
Rianna
05-27-2006, 12:09 AM
Not quite sure. Is that a css command, do I need to make its own rule? If so I don't see the . that goes before button. .button for a css rule. Or am I supposed to just put this part "{ color:#f00 }" within the button tags? Let me know please, thanks!
CrazyMerlin
05-27-2006, 12:23 AM
if you just use: button { color:#f00 }
it will change the color of all instances of button.
if you want to change just one, set it as a class with a period in front of it, or put a # in front of it and refer to it by id
#thisButton {
.
.
.
}
<button id="thisButton">
I have spent too long lately doing .net and am forgetting css...lol
Rianna
05-27-2006, 12:57 AM
Wooo got it thank you very much! Don't forget the hyphen in background-color. :D
ray326
05-27-2006, 10:22 AM
If you REALLY want a particular button to ALWAYS be a certain way then use inline styles.
<button style="color:#f00">click me</button>