我有一些输入类型具有此scss设置(来自框架)
textarea,
input[type="text"],
input[type="password"],
input[type="datetime"],
...
input[type="date"],
input[type="month"],
input[type="time"],
input[type="week"],
{
@include box-shadow(inset 0 1px 1px rgba(0,0,0,.075));
}
我喜欢覆盖/重置所有类似的东西
textarea,
input[type="*"],
{
@include box-shadow(none);
}
以上不起作用,也
textarea,
input,
{
@include box-shadow(none);
}
不够具体。除了列出所有可能的类型之外,还有什么方法可以做到这一点。
谢谢。
这样就足够了吗?
They both have the same specificity, so the last one overrides.
See jsFiddle: http://jsfiddle.net/TheNix/T2BbG/
Another solution would be to ommit the element from the first selector. The latter would have higher specificity – however, you should know that in terms of performance, the first one is similar to using an universal selector (as it attempts to match all elements in the DOM, to check for the attribute).