Applying Css on input button

Discussion in 'HTML' started by Von Shean, May 28, 2004.

  1. Von Shean

    Von Shean Guest

    I want the buttons in my application to have a different background color.
    I have tried the following ways of delaclarations in css that did not work
    for me


    input.button.
    {BACKGROUND: #d6e7ef}

    input[type=button]
    {BACKGROUND: #d6e7ef}


    I have IE6.

    Is there anyway i can apply application wide change to input buttons
    button's background.

    Thank you.
     
    Von Shean, May 28, 2004
    #1
    1. Advertising

  2. Von Shean

    brucie Guest

    in post: <news:>
    Von Shean <> said:

    > I want the buttons in my application to have a different background color.


    be aware that browser support varies a lot with form elements and/or
    browser options may disallow your style suggestions.

    > input.button.
    > {BACKGROUND: #d6e7ef}


    you have a period after the 'n' and i suspect you haven't given the
    input the 'button' class:

    <input type="button" ... class="button">

    a better class name would be appropriate

    > input[type=button]


    attribute selectors are not supported by IE

    > I have IE6.


    it doesn't matter what you have but what your visitors have.

    > Is there anyway i can apply application wide change to input buttons
    > button's background.


    give them all the same class or ignore crappy IE and use an attribute
    selector.

    --
    b r u c i e
     
    brucie, May 28, 2004
    #2
    1. Advertising

  3. Von Shean

    Von Shean Guest

    Thank you for the quick reply
    Actually what i am trying to avoid is

    <input type="button" ... class="button">
    -------------------------^^^^^^^^^^------

    I am trying to avoid the change in the complete application. Is There a way
    around it.

    Thanks

    "brucie" <> wrote in message
    news:...
    > in post: <news:>
    > Von Shean <> said:
    >
    > > I want the buttons in my application to have a different background

    color.
    >
    > be aware that browser support varies a lot with form elements and/or
    > browser options may disallow your style suggestions.
    >
    > > input.button.
    > > {BACKGROUND: #d6e7ef}

    >
    > you have a period after the 'n' and i suspect you haven't given the
    > input the 'button' class:
    >
    > <input type="button" ... class="button">
    >
    > a better class name would be appropriate
    >
    > > input[type=button]

    >
    > attribute selectors are not supported by IE
    >
    > > I have IE6.

    >
    > it doesn't matter what you have but what your visitors have.
    >
    > > Is there anyway i can apply application wide change to input buttons
    > > button's background.

    >
    > give them all the same class or ignore crappy IE and use an attribute
    > selector.
    >
    > --
    > b r u c i e
    >
    >
     
    Von Shean, May 28, 2004
    #3
  4. "Von Shean" <> wrote:

    > Thank you for the quick reply


    You could express your gratitude better by complying with Usenet
    netiquette, like adequate quoting.

    > Actually what i am trying to avoid is
    >
    > <input type="button" ... class="button">
    > -------------------------^^^^^^^^^^------
    >
    > I am trying to avoid the change in the complete application. Is There
    > a way around it.


    (So you actually knew _a_ solution but did not bother mentioning it, and
    the CSS code you actually use now is different from what you posted.)

    With the implicit conditions, no. IE just does not support attribute
    selectors, period. Well, under some circumstances, you might be able to
    save some class attributes by using them on enclosing elements and using
    simple contextual selectors (which are well supported). But you gave
    absolutely no information about the situation as a whole, such as a URL,
    so you have deprived us of real possibilities of helping you there.

    By the way, according to statistics, 99.8 % of all attempts to change
    form field appearance are based on misunderstandings, and they really
    hurt when they "succeed". Just let buttons be buttons, mm'kay? (According
    to statistics, 96.9 % of all percentages have just been made up, but
    98.7 % of peple take them seriously anyway.)

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
     
    Jukka K. Korpela, May 28, 2004
    #4
  5. Von Shean

    shlover143

    Joined:
    Jun 22, 2010
    Messages:
    1
    use class

    Try Out this.....

    <style>

    input .classname { background-color:#000000; }

    </style>

    <html>
    <body>
    <input type="button" class="classname" value="button">
    </body>
    </html>

    If you satisfied visit my site
    magic-pitara.blogspot.com
     
    shlover143, Jun 22, 2010
    #5
    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. Prakash
    Replies:
    6
    Views:
    5,058
    Prakash
    Nov 9, 2005
  2. Noozer
    Replies:
    2
    Views:
    6,434
    Noozer
    Sep 26, 2004
  3. =?Utf-8?B?TmVpbCBTdGV2ZW50b24=?=

    Applying CSS Styles to Dropdownlist

    =?Utf-8?B?TmVpbCBTdGV2ZW50b24=?=, May 15, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    61,097
    Juan T. Llibre
    May 15, 2006
  4. Replies:
    1
    Views:
    467
    Andrew Thompson
    Aug 13, 2006
  5. bizt
    Replies:
    3
    Views:
    140
Loading...

Share This Page