SCSS/CSS selector to select all input types

后端 未结 2 1004
借酒劲吻你
借酒劲吻你 2021-02-02 09:11

I have some input type has this scss setting (from the framework)

textarea,
input[type=\"text\"],
input[type=\"password\"],
input[type=\"datetime\"],
...
input[t         


        
2条回答
  •  一向
    一向 (楼主)
    2021-02-02 09:19

    There are a lot of possible input types. If you want textareas and any input that has a type attribute then...

    textarea,
    input[type] {
        ...
    }
    

    If you want to exclude some input types then use the :not selector. EDIT EXAMPLE JSFIDDLE http://jsfiddle.net/Pnbb8/

    textarea,
    input[type]:not([type=search]):not([type=url]):not([type=hidden]) {
    
    }
    

    But like I said there are probably a lot more types you DON'T want than types you DO want, so you can't really avoid the list.

    You could always use a CSS class instead.

    .box-shadowed
    {
      @include box-shadow(none);
    }
    

提交回复
热议问题