Applying Css on input button


V

Von Shean

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.
 
Ad

Advertisements

B

brucie

in post: <
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.
 
V

Von Shean

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 said:
in post: <
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.
 
J

Jukka K. Korpela

Von Shean said:
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.)
 
Ad

Advertisements

Joined
Jun 22, 2010
Messages
1
Reaction score
0
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
 

Top