472,958 Members | 2,556 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

On button

129 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
4 1390
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
7,435 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
7,435 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

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

Similar topics

3
by: Matt | last post by:
I want to understand the difference between submit button and regular button: <input type="submit"> and <input type="button">. My understanding is that submit button will send the entire HTML form...
6
by: Skip Hollowell | last post by:
I am working on a menu bar for a site, and am using buttons in the bar (because the customer wants to use accessKeys for each selection, apparently it is too much work to click on them with a...
5
by: TrvlOrm | last post by:
Can any one please help me...I am new to JavaScript and I have been struggling with this code for days now and can't figure it out. I would like to get the Buttons to correspond with the action...
14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
25
by: KK | last post by:
Hi, I am using history.go(-1) for implementing the back button functionality. Its working fine but with this exception. 1. The page which is having back button has some hyperlinks on it. ...
3
by: Zürcher See | last post by:
Someone has implemented a Datagrid Button for the Windows.Form?
18
by: jrhoads23 | last post by:
Hello, I am trying to find a way to tell if an .NET windows forms Button (System.Windows.Forms.Button) is "depressed" (pushed down). For my application, I can not use a check box control set to...
18
by: Colin McGuire | last post by:
Hi - this was posted last weekend and unfortunately not resolved. The solutions that were posted almost worked but after another 5 days of working on the code everynight, I am not further ahead....
7
by: =?Utf-8?B?bWFydGluMQ==?= | last post by:
Hi, All, I create button in the code ( Dim Button as new Button), not using button web component (means not drap button and drop it ont he webform), after that I try to use button_click event,...
23
by: shashi shekhar singh | last post by:
Dear sir, I have a word document file contains text and images, now i have saved it as a web page and wants to display it on browser , using , string str=directory.getfiles("");...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.