467,907 Members | 1,405 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,907 developers. It's quick & easy.

On button

100+
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
  • viewed: 1223
Share:
4 Replies
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 4TB
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 4TB
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
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.

Similar topics

6 posts views Thread by Skip Hollowell | last post: by
5 posts views Thread by TrvlOrm | last post: by
25 posts views Thread by KK | last post: by
3 posts views Thread by ZŁrcher See | last post: by
18 posts views Thread by Colin McGuire | last post: by
7 posts views Thread by =?Utf-8?B?bWFydGluMQ==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.