On button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sasimca007
    New Member
    • Sep 2007
    • 129

    On button

    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:

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

    <font color=red><inpu t type="button" name="click" value="Add Comment" style="font-color: red"></font>[/CODE]

    So, my option is that put the color for Add Comment. Please try for me and suggest me.
    Last edited by eWish; Feb 23 '08, 01:59 PM. Reason: Please use [code][/code] tags
  • npidaparthy
    New Member
    • Feb 2008
    • 14

    #2
    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

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    
    <HTML>
    <HEAD> <TITLE> Color on Buttons with CSS</TITLE>
    
    <style type="text/css">
    .altButtonFormat {
    background-color: #c0c0c0;
    font-family: verdana;
    border: #000000 1px solid;
    font-size: 12px;
    color: RED
    } 
    </style> 
    
    </HEAD>
    <BODY >
    
    <FORM name="form1" action="" method="POST" >
    
    <INPUT type=submit value=Submit class="altButtonFormat">		
    <INPUT type=reset value=Reset class ="altButtonFormat">
    
    <FORM>
    </BODY>
    </HTML>

    Originally posted by sasimca007
    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><inpu t 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.

    Comment

    • drhowarddrfine
      Recognized Expert Expert
      • Sep 2006
      • 7434

      #3
      There is no such thing as 'font-color' in CSS. Just change that to 'color:red' and it will work.

      Comment

      • drhowarddrfine
        Recognized Expert Expert
        • Sep 2006
        • 7434

        #4
        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">

        Comment

        • npidaparthy
          New Member
          • Feb 2008
          • 14

          #5
          Thanks ,

          on copy paste it got misplaced.

          -Nagendra

          Originally posted by drhowarddrfine
          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">

          Comment

          Working...