热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

禁用兄弟输入时将CSS应用于元素

如何解决《禁用兄弟输入时将CSS应用于元素》经验,为你挑选了1个好方法。

我在尝试将样式应用于兄弟元素时遇到了问题.

.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;
}
test
testing2

推荐阅读
author-avatar
隐之王语录
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有