Css for text field

How to do to add a CSS rule for the entire text field?
I know that:

input{}

for all input, but if I want especially type = "text"?

+3
source share
4 answers

Use the attribute selector :

input[type="text"]
{
  /* ... */
}
+11
source
input[type="text"] { color: orange; }
+6
source

Use this attribute selector :

input[type="text"]
+3
source

If your platform supports an attribute selector, then great - use them. But if that is not the case, you need to apply a class attribute to each of your text inputs to distinguish them from radio buttons or check boxes in CSS.

0
source

All Articles