Input

liunx

Guest
Ok, I have the following line of code in my CSS to format all input elements:input {
background-color: #f9c;
border: 1px solid #f90;
}
But say I wanted to style my text input elements differently... I tried this:input text {
background-color: #f9c;
border: 1px solid #f90;
}
But that didn't work. Can someone tell me what I have to do? Thanks,
-Dantry just using
input{color:#f9c;}But that formats all input elements (radio buttons, buttons, text, check boxes, etc.). I need it to format only the text input elements.
-Danif you mean text area use
textarea{color:#f9c;}You could use this:input[type^="text"]{
background-color: #f9c;
border: 1px solid #f90;
}But it's CSS 3 so you can forget about IE compatibility, IE is still struggling to come to terms with CSS 2.

What would be better is if you were to simply give you text input's a class and use that to reference them:input.cssonefriendly{
background-color: #f9c;
border: 1px solid #f90;
}
 
Back
Top