49

I tried to change the color of the text in the submit button type but, I don't know why I am not able to change it.

.button { width: 105px; height: 20px; background-image: url('tiny.gif'); line-height: 20px; padding-bottom: 2px; vertical-align: middle; font-family: "Lucida Grande", Geneva, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; <!--font-weight: bold; -->text-transform: none; border: 1px solid transparent; } .button:hover { background-image: url('tiny_.gif'); }
<input type="submit" value="Fetch" class="button" />

I was getting a problem when I tried to change the color of the submit button.

1
  • 2
    "Getting problems" -- this does't help us at all. What are you expecting to have happen? What is actually happening? Are there any messages in your console log? I added background-color: red to your :hover and the button changed colors when I moused over. Perhaps tiny_.gif isn't loading? Commented Sep 18, 2012 at 11:07

7 Answers 7

85

.button { font-size: 13px; color:green; }
<input type="submit" value="Fetch" class="button"/>

Sign up to request clarification or add additional context in comments.

Comments

25

you try this:

<input type="submit" style="font-face: 'Comic Sans MS'; font-size: larger; color: teal; background-color: #FFFFC0; border: 3pt ridge lightgrey" value=" Send Me! "> 

2 Comments

Inline styles are not a good idea when an external stylesheet is available.
it's very good idea for poor css-ed pages, and for test how page will be rendered. for full css-ed pages this should be moved to external css file.
7
<button id="fwdbtn" style="color:red">Submit</button> 

Comments

5

Use this CSS:

color: red; 

that's all.

Comments

3

I had the same thought of wanting to change the text color rather than the button color itself to a different color. Here's what you can do:

button { color: black; /* This is for the font color of the button */ background-color: aqua; /* This is for the color of the button */ height: 70px; width: 70px; } 

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
-1
.btn{ font-size: 20px; color:black; } 

2 Comments

Could you explain your solution, only code is a bit hard to undestand correctly the answer
While this code may answer the question, providing additional context regarding how and/or why it solves the problem would improve the answer's long-term value.
-2
<input type = "button" style ="background-color:green"/> 

1 Comment

OP wants to change text color of a submit and you provide him with an inline style (=bad practice) changing background color of a button. This doesn't help much...

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.