CSS with input elements
-
Hi.. I make a css file with the following lines:
input { border-right: white thin solid; border-top: white thin solid; border-left: white thin solid; color: white; border-bottom: white thin solid; background-color: #0033ff; }
I want to apply the style for only not all input controls.. How can I do it ? -
Hi.. I make a css file with the following lines:
input { border-right: white thin solid; border-top: white thin solid; border-left: white thin solid; color: white; border-bottom: white thin solid; background-color: #0033ff; }
I want to apply the style for only not all input controls.. How can I do it ?You can't. CSS is for elements, not attributes. What you can do instead is define an element class, either:
input.button
(limits class to input elements) or a stand-alone class like.button
(can be used on any element). Then, specify the class attribute in your code:<input type=button class=button>
.Reminiscent of my younger years...
10 LOAD "SCISSORS" 20 RUN
-
You can't. CSS is for elements, not attributes. What you can do instead is define an element class, either:
input.button
(limits class to input elements) or a stand-alone class like.button
(can be used on any element). Then, specify the class attribute in your code:<input type=button class=button>
.Reminiscent of my younger years...
10 LOAD "SCISSORS" 20 RUN
In CSS2 one can match attributes (see Attribute selectors[^]). But IE doesn't support CSS2, one have to go with style classes :)