本文介绍了Css伪类输入:not(disabled)not:[type =" submit"]:focus的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想对输入元素应用一些CSS,我想这样做只有输入没有禁用,并且不提交类型,下面css不工作,也许如果有人可以解释我如何必须添加。 / p>

I want to apply some css for inputs elements and I want to do that only for inputs that are not disabled and are not submit type, below css is not working, maybe if someone can explain me how this must be added .

input:not(disabled)not:[type="submit"]:focus{
box-shadow:0 0 2px 0 #0066FF;
-webkit-box-shadow:0 0 4px 0 #66A3FF;
}


推荐答案

>

Instead of:

input:not(disabled)not:[type="submit"]:focus {}

使用:

input:not([disabled]):not([type="submit"]):focus {}

disabled 是一个属性,所以它需要括号,你似乎混淆了/缺少冒号和括号在:not() selector。

disabled is an attribute so it needs the brackets, and you seem to have mixed up/missing colons and parentheses on the :not() selector.

演示: http://jsfiddle.net/HSKPx/

有一点要注意:我可能错了,但我不认为禁用输入可以正常接收焦点,这样部分可能是多余的。

One thing to note: I may be wrong, but I don't think disabled inputs can normally receive focus, so that part may be redundant.

这篇关于Css伪类输入:not(disabled)not:[type =" submit"]:focus的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 02:27