In CSS is there a selector for referencing a specific input type that also has a class?
CssCss SelectorsCss Problem Overview
Basically I want a CSS selector that grabs all input[type="text"] but that also has a class "some-class".
Both of the following don't seem to be working for me:
input[type="text"] .some-class {} /* doesn't work */
.some-class input[type="text"] {} /* doesn't work */
I'm sure I'm missing something simple here. Thanks in advance.
Css Solutions
Solution 1 - Css
You want input.some-class[type="text"]
.some-class input
looks for input tags that are descendants of .some-class
.
input.some-class
does the reverse.
Solution 2 - Css
input[type="text"].some-class {
....
}
with no space between "input[type="text"]" and ".some-class" will work..
input[type="text"]-space in between is the problem-.some-class {}