In CSS is there a selector for referencing a specific input type that also has a class?

前端 未结 2 651
予麋鹿
予麋鹿 2021-02-01 12:32

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:

相关标签:
2条回答
  • 2021-02-01 13:15
        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 {}

    0 讨论(0)
  • 2021-02-01 13:18

    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.

    0 讨论(0)
提交回复
热议问题