Coloured Buttons

Discussion in 'HTML' started by Venkat, Jun 30, 2003.

  1. Venkat

    Venkat Guest

    Hi,

    I am writing this piece of html code
    <input type = button value ="BookmarkedPage" id=button name =
    BookmarkedPage>
    to show the following button, i want to know if this button can be shown in
    a coloured way.

    if i put a parameter in input tag as color = red it doesn't work.

    Is there anyway to do it?

    Regards
    Venkat
     
    Venkat, Jun 30, 2003
    #1
    1. Advertising

  2. Venkat

    Steve Pugh Guest

    "Venkat" <> wrote:

    >I am writing this piece of html code
    ><input type = button value ="BookmarkedPage" id=button name =
    >BookmarkedPage>
    >to show the following button, i want to know if this button can be shown in
    >a coloured way.


    input type="button" is only useful in conjunction with client side
    scripting, I hope your pages make provision for when such scripting is
    not supported or enabled.

    >if i put a parameter in input tag as color = red it doesn't work.


    You can't just invent attributes and expect them to work.

    Changing the presentation of anything is best done with CSS.

    #button { color: red;}

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Jun 30, 2003
    #2
    1. Advertising

  3. Steve Pugh wrote:
    > Changing the presentation of anything is best done with CSS.
    >
    > #button { color: red;}


    He probably wants to change the colour of the button, not its text. If
    so, use:

    #button { background-color: red;}
     
    Leif K-Brooks, Jul 1, 2003
    #3
  4. Venkat

    Steve Pugh Guest

    Leif K-Brooks <> wrote:

    >Steve Pugh wrote:
    >> Changing the presentation of anything is best done with CSS.
    >>
    >> #button { color: red;}

    >
    >He probably wants to change the colour of the button, not its text.


    Maybe, but the analogy was with a fictional HTML color attribute. Not
    a fictional HTML bgcolor attribute.

    > If so use:
    >
    > #button { background-color: red;}


    To avoid clashes with user stylesheets or just with browser defaults
    (black on red, or red on grey are both hard to read) both should be
    specified:

    #button {
    color: yellow;
    background: red;
    }

    The background property is favoured over background-color because (a)
    it's shorter and (b) it sets background-image to none thus over riding
    any user stylesheet.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Jul 1, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    374
  2. Thibault

    How to do a coloured line

    Thibault, Oct 7, 2004, in forum: HTML
    Replies:
    9
    Views:
    8,220
    Jan Faerber
    Oct 11, 2004
  3. Replies:
    9
    Views:
    378
    Geoffrey Clements
    Feb 2, 2007
  4. sudip

    coloured text...

    sudip, Jul 1, 2005, in forum: C Programming
    Replies:
    4
    Views:
    421
    Dik T. Winter
    Jul 7, 2005
  5. Ghai

    coloured text in console

    Ghai, Apr 19, 2006, in forum: C++
    Replies:
    4
    Views:
    424
    Alf P. Steinbach
    Apr 19, 2006
Loading...

Share This Page