input type=text/radio/checkbox - can I treat them differently in my CSS?
Other than by adding class=
I mean
If you only want to style a specific input type, you can use attribute selectors: input[type=text] - will only select text fields. input[type=password] - will only select password fields. input[type=number] - will only select number fields.
CSS attribute selectors select specific CSS input types for styling: input[type=text] - selects form fields that accept text. input[type=password] - selects form fields that accept passwords. input[type=number] - selects form fields that accept numbers. etc.
YES!
With an awesome thing called attribute selectors:
input[type="text"] { width: 200px; }
Just change that text
there and you're good to go!
But note that these don't work on IE6, so you might want to take a look at the dean.edwards.name IE7.js :)
You can use the attribute selector, like this
input[type=text] { ... }
However, this is not supported in all browsers. Your safest bet is to use a class
You can use input[type=text]
to do this. Old browsers might not support it though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With