Css 伪类 input:not(disabled)not:[type="submit"]:focu

2022-10-28前端开发问题
55

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

问题描述

我想为输入元素应用一些 css,并且我只想对未禁用且非提交类型的输入执行此操作,下面的 css 不起作用,也许如果有人可以解释我必须如何添加它.

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;
}

推荐答案

代替:

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

用途:

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

disabled 是一个属性,因此它需要括号,并且您似乎在 :not() 选择器上混淆了/缺少冒号和括号.

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/

需要注意的一点:我可能是错的,但是我不认为 disabled 输入可以正常接收焦点,所以那部分可能是多余的.

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.

或者,使用 :enabled

input:enabled:not([type="submit"]):focus { /* styles here */ }

再次,我想不出禁用输入可以接收焦点的情况,因此似乎没有必要.

Again, I can't think of a case where disabled input can receive focus, so it seems unnecessary.

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

The End
led led设备

相关推荐

在 Drupal 7 中未调用 Javascript 函数,该函数曾经在 Drupal 6 中正常运行
Javascript function not getting called in Drupal 7 which used to run proper in Drupal 6(在 Drupal 7 中未调用 Javascript 函数,该函数曾经在 Drupal 6 中正常运行)...
2024-04-19 前端开发问题
7

未处理的拒绝错误 Bluebird
Unhandled rejection error Bluebird(未处理的拒绝错误 Bluebird)...
2024-04-19 前端开发问题
3

在 CoffeeScript 中,是否有一种“官方"方法可以在运行时而不是在编译时插入字符串?
In CoffeeScript, is there an #39;official#39; way to interpolate a string at run-time instead of when compiled?(在 CoffeeScript 中,是否有一种“官方方法可以在运行时而不是在编译时插入字符串?)...
2024-04-19 前端开发问题
4

禁用按钮仍然监听点击事件
Disabled button still listens to click event(禁用按钮仍然监听点击事件)...
2024-04-19 前端开发问题
36

Promise allSettled 不是函数
Promise allSettled is not a function(Promise allSettled 不是函数)...
2023-11-29 前端开发问题
95

升级到 expo SDK 37.0.0 后,我的 stackNavigator 标头高度增加了一倍
After upgrading to expo SDK 37.0.0 my stackNavigator header doubled in height(升级到 expo SDK 37.0.0 后,我的 stackNavigator 标头高度增加了一倍)...
2023-11-29 前端开发问题
4