作者:隐之王语录 | 来源:互联网 | 2022-12-25 00:51
我在尝试将样式应用于兄弟元素时遇到了问题.
.ac_numeric input[type=text][disabled] {
cursor: not-allowed;
}
这一切都运行正常,当它被禁用时将"不允许"光标应用于我的输入但我还需要在禁用输入时将光标添加到我的div class="numericbuttonswrapper"
.
通过可用的css选择器时我找不到答案,这可能吗?
1> roberrrt-s..:
使用相邻的兄弟选择器(+)
.ac_numeric input[type=text][disabled],
.ac_numeric input[type=text][disabled] + .numericbuttonswrapper {
cursor: not-allowed;
}
.ac_numeric input[type=text][disabled],
.ac_numeric input[type=text][disabled] + .numericbuttonswrapper {
cursor: not-allowed;
}