By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,396 Members | 1,869 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,396 IT Pros & Developers. It's quick & easy.

On button

100+
P: 129
Hello friends,
I have a doubt on the button and that is how to set the color for the text that is displayed on the button. I tried on following ways:

Expand|Select|Wrap|Line Numbers
  1. <input type="button" name="click" value="Add Comment" style="font-color: red">
  2.  
  3. <font color=red><input type="button" name="click" value="Add Comment" style="font-color: red"></font>
So, my option is that put the color for Add Comment. Please try for me and suggest me.
Feb 23 '08 #1
Share this Question
Share on Google+
4 Replies


P: 14
For getting color in buttons you need to use CSS [cascading stylesheets]

see the below code i have written which will print the text on Button in Red color

let me know if this helps you.

-Nagendra

Expand|Select|Wrap|Line Numbers
  1.  
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
  3. "http://www.w3.org/TR/html4/strict.dtd">
  4.  
  5. <HTML>
  6. <HEAD> <TITLE> Color on Buttons with CSS</TITLE>
  7.  
  8. <style type="text/css">
  9. .altButtonFormat {
  10. background-color: #c0c0c0;
  11. font-family: verdana;
  12. border: #000000 1px solid;
  13. font-size: 12px;
  14. color: RED
  15. </style> 
  16.  
  17. </HEAD>
  18. <BODY >
  19.  
  20. <FORM name="form1" action="" method="POST" >
  21.  
  22. <INPUT type=submit value=Submit class="altButtonFormat">        
  23. <INPUT type=reset value=Reset class ="altButtonFormat">
  24.  
  25. <FORM>
  26. </BODY>
  27. </HTML>
  28.  
  29.  
  30.  

Hello friends,
I have a doubt on the button and that is how to set the color for the text that is displayed on the button. I tried on following ways:

<input type="button" name="click" value="Add Comment" style="font-color: red">

<font color=red><input type="button" name="click" value="Add Comment" style="font-color: red"></font>

So, my option is that put the color for Add Comment. Please try for me and suggest me.
Feb 23 '08 #2

drhowarddrfine
Expert 5K+
P: 7,435
There is no such thing as 'font-color' in CSS. Just change that to 'color:red' and it will work.
Feb 23 '08 #3

drhowarddrfine
Expert 5K+
P: 7,435
Nagendra,
Your doctype is incomplete and all new pages should always use a strict one.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
Feb 23 '08 #4

P: 14
Thanks ,

on copy paste it got misplaced.

-Nagendra

Nagendra,
Your doctype is incomplete and all new pages should always use a strict one.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
Feb 23 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.